aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/include/asm/arch-rda/reg_sysctrl_rda8850.h
blob: 6b0169fc8919655b9ade75b734e073843b3f0757 (plain)
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
#ifndef _REG_SYSCTRL_H_
#define _REG_SYSCTRL_H_

#include <asm/arch/hardware.h>
#include <asm/arch/rda_iomap.h>

// =============================================================================
//  MACROS
// =============================================================================

// ============================================================================
// AP_CPU_ID_T
// -----------------------------------------------------------------------------
/// 
// =============================================================================
typedef enum
{
/// CPU IDs
    CPU0                                        = 0x00000000,
    CPU1                                        = 0x00000001
} AP_CPU_ID_T;


// ============================================================================
// CPU_CLKS_T
// -----------------------------------------------------------------------------
/// 
// =============================================================================
typedef enum
{
/// AP CPU side System clocks
    CPU_CORE                                    = 0x00000000,
/// the following don't have an auto enable
    CPU_DUMMY                                   = 0x00000001
} CPU_CLKS_T;

#define NB_CPU_CLK_AEN                          (1)
#define NB_CPU_CLK_EN                           (2)
#define NB_CPU_CLK                              (2)

// ============================================================================
// AXI_CLKS_T
// -----------------------------------------------------------------------------
/// 
// =============================================================================
typedef enum
{
/// AP AXI side System clocks: AXI and AHB0 and APB0
    AHB0_CONF                                   = 0x00000000,
    APB0_CONF                                   = 0x00000001,
    AXI_VOC                                     = 0x00000002,
    AXI_VOC2                                    = 0x00000003,
    AXI_DMA                                     = 0x00000004,
/// the following don't have an auto enable
    AXI_ALWAYS                                  = 0x00000005,
    AXI_CONNECT                                 = 0x00000006,
    APB0_IRQ                                    = 0x00000007
} AXI_CLKS_T;

#define NB_AXI_CLK_AEN                          (5)
#define NB_AXI_CLK_EN                           (8)
#define NB_AXI_CLK                              (8)

// ============================================================================
// AXIDIV2_CLKS_T
// -----------------------------------------------------------------------------
/// 
// =============================================================================
typedef enum
{
/// AP AXIdiv2 side System clocks
    AXIDIV2_IMEM                                = 0x00000000,
/// the following don't have an auto enable
    AXIDIV2_ALWAYS                              = 0x00000001,
    AXIDIV2_CONNECT                             = 0x00000002,
    AXIDIV2_VPU                                 = 0x00000003
} AXIDIV2_CLKS_T;

#define NB_AXIDIV2_CLK_AEN                      (1)
#define NB_AXIDIV2_CLK_EN                       (4)
#define NB_AXIDIV2_CLK                          (4)

// ============================================================================
// GCG_CLKS_T
// -----------------------------------------------------------------------------
/// 
// =============================================================================
typedef enum
{
/// AP GCG side System clocks
    GCG_APB_CONF                                = 0x00000000,
    GCG_GOUDA                                   = 0x00000001,
    GCG_CAMERA                                  = 0x00000002,
/// the following don't have an auto enable
    GCG_ALWAYS                                  = 0x00000003,
    GCG_CONNECT                                 = 0x00000004
} GCG_CLKS_T;

#define NB_GCG_CLK_AEN                          (3)
#define NB_GCG_CLK_EN                           (5)
#define NB_GCG_CLK                              (5)

// ============================================================================
// AHB1_CLKS_T
// -----------------------------------------------------------------------------
/// 
// =============================================================================
typedef enum
{
/// AP AHB1 side System clocks
    AHB1_USBC                                   = 0x00000000,
/// the following don't have an auto enable
    AHB1_ALWAYS                                 = 0x00000001,
    AHB1_SPIFLASH                               = 0x00000002
} AHB1_CLKS_T;

#define NB_AHB1_CLK_AEN                         (1)
#define NB_AHB1_CLK_EN                          (3)
#define NB_AHB1_CLK                             (3)

// ============================================================================
// APB1_CLKS_T
// -----------------------------------------------------------------------------
/// 
// =============================================================================
typedef enum
{
/// AP APB1 side System clocks
    APB1_CONF                                   = 0x00000000,
    APB1_AIF                                    = 0x00000001,
    APB1_AIF2                                   = 0x00000002,
    APB1_AUIFC                                  = 0x00000003,
    APB1_AUIFC_CH0                              = 0x00000004,
    APB1_AUIFC_CH1                              = 0x00000005,
    APB1_AUIFC_CH2                              = 0x00000006,
    APB1_AUIFC_CH3                              = 0x00000007,
    APB1_I2C1                                   = 0x00000008,
    APB1_I2C2                                   = 0x00000009,
    APB1_I2C3                                   = 0x0000000A,
/// AP APB1 side divided clock (either divided by module or by clock_ctrl)
    APB1D_OSC                                   = 0x0000000B,
    APB1D_PWM                                   = 0x0000000C,
/// the following don't have an auto enable
    APB1_ALWAYS                                 = 0x0000000D,
    APB1_DAPLITE                                = 0x0000000E,
    APB1_TIMER                                  = 0x0000000F,
    APB1_GPIO                                   = 0x00000010
} APB1_CLKS_T;

#define NB_APB1_CLK_AEN                         (13)
#define NB_APB1_CLK_EN                          (17)
#define NB_APB1_CLK                             (17)

// ============================================================================
// APB2_CLKS_T
// -----------------------------------------------------------------------------
/// 
// =============================================================================
typedef enum
{
/// AP APB2 side System clocks
    APB2_CONF                                   = 0x00000000,
    APB2_IFC                                    = 0x00000001,
    APB2_IFC_CH0                                = 0x00000002,
    APB2_IFC_CH1                                = 0x00000003,
    APB2_IFC_CH2                                = 0x00000004,
    APB2_IFC_CH3                                = 0x00000005,
    APB2_IFC_CH4                                = 0x00000006,
    APB2_IFC_CH5                                = 0x00000007,
    APB2_IFC_CH6                                = 0x00000008,
    APB2_IFC_CH7                                = 0x00000009,
    APB2_UART1                                  = 0x0000000A,
    APB2_UART2                                  = 0x0000000B,
    APB2_UART3                                  = 0x0000000C,
    APB2_SPI1                                   = 0x0000000D,
    APB2_SPI2                                   = 0x0000000E,
    APB2_SPI3                                   = 0x0000000F,
    APB2_SDMMC1                                 = 0x00000010,
    APB2_SDMMC2                                 = 0x00000011,
    APB2_SDMMC3                                 = 0x00000012,
/// the following don't have an auto enable
    APB2_ALWAYS                                 = 0x00000013,
    APB2_NANDFLASH                              = 0x00000014
} APB2_CLKS_T;

#define NB_APB2_CLK_AEN                         (19)
#define NB_APB2_CLK_EN                          (21)
#define NB_APB2_CLK                             (21)

// ============================================================================
// MEM_CLKS_T
// -----------------------------------------------------------------------------
/// 
// =============================================================================
typedef enum
{
/// AP MEM side System clocks
    MEM_CONF                                    = 0x00000000,
/// the following don't have an auto enable
    MEM_DMC                                     = 0x00000001,
    MEM_GPU                                     = 0x00000002,
    MEM_VPU                                     = 0x00000003,
    MEM_DDRPHY_P                                = 0x00000004,
    MEM_CONNECT                                 = 0x00000005
} MEM_CLKS_T;

#define NB_MEM_CLK_AEN                          (1)
#define NB_MEM_CLK_EN                           (6)
#define NB_MEM_CLK                              (6)

// ============================================================================
// APO_CLKS_T
// -----------------------------------------------------------------------------
/// 
// =============================================================================
typedef enum
{
/// AP side Other clocks
/// clocks with auto enble
    APOC_VPU                                    = 0x00000000,
    APOC_BCK                                    = 0x00000001,
    APOC_BCK2                                   = 0x00000002,
    APOC_UART1                                  = 0x00000003,
    APOC_UART2                                  = 0x00000004,
    APOC_UART3                                  = 0x00000005,
    APOC_VOC_CORE                               = 0x00000006,
    APOC_VOC2_CORE                              = 0x00000007,
    APOC_VOC                                    = 0x00000008,
    APOC_VOC2                                   = 0x00000009,
/// the following don't have an auto enable
    APOC_VOC_ALWAYS                             = 0x0000000A,
    APOC_VOC2_ALWAYS                            = 0x0000000B,
    APOC_DDRPHY_N                               = 0x0000000C,
    APOC_DDRPHY2XP                              = 0x0000000D,
    APOC_DDRPHY2XN                              = 0x0000000E,
    APOC_GPU                                    = 0x0000000F,
    APOC_USBPHY                                 = 0x00000010,
    APOC_CSI                                    = 0x00000011,
    APOC_DSI                                    = 0x00000012,
    APOC_GPIO                                   = 0x00000013,
    APOC_SPIFLASH                               = 0x00000014,
    APOC_PIX                                    = 0x00000015,
    APOC_PDGB                                   = 0x00000016
} APO_CLKS_T;

#define NB_CLK_VOC_AEN_SYNC                     (6)
#define NB_CLK_VOC_CORE                         (8)
#define NB_APO_CLK_AEN                          (10)
#define NB_CLK_VOC_END                          (12)
#define NB_APO_CLK_EN                           (23)
#define NB_APO_CLK                              (23)

// ============================================================================
// CPU_RESETS_T
// -----------------------------------------------------------------------------
/// 
// =============================================================================
typedef enum
{
/// AP CPU side resets
    CPU_RST_CORE                                = 0x00000000,
    CPU_RST_SYS                                 = 0x00000001
} CPU_RESETS_T;

#define NB_CPU_RST                              (2)

// ============================================================================
// AXI_RESETS_T
// -----------------------------------------------------------------------------
/// 
// =============================================================================
typedef enum
{
/// AP AXI side resets: AXI and AHB0 and APB0
    AXI_RST_VOC                                 = 0x00000000,
    AXI_RST_VOC2                                = 0x00000001,
    AXI_RST_DMA                                 = 0x00000002,
    AXI_RST_SYS                                 = 0x00000003,
    AXI_RST_CONNECT                             = 0x00000004,
    AHB0_RST_GPU                                = 0x00000005,
    APB0_RST_VPU                                = 0x00000006,
    APB0_RST_IRQ                                = 0x00000007
} AXI_RESETS_T;

#define NB_AXI_RST                              (8)

// ============================================================================
// AXIDIV2_RESETS_T
// -----------------------------------------------------------------------------
/// 
// =============================================================================
typedef enum
{
/// AP AXIDIV2 side resets
    AXIDIV2_RST_IMEM                            = 0x00000000,
    AXIDIV2_RST_SYS                             = 0x00000001,
    AXIDIV2_RST_VPU                             = 0x00000002
} AXIDIV2_RESETS_T;

#define NB_AXIDIV2_RST                          (3)

// ============================================================================
// GCG_RESETS_T
// -----------------------------------------------------------------------------
/// 
// =============================================================================
typedef enum
{
/// AP GCG side resets
    GCG_RST_SYS                                 = 0x00000000,
    GCG_RST_GOUDA                               = 0x00000001,
    GCG_RST_CAMERA                              = 0x00000002
} GCG_RESETS_T;

#define NB_GCG_RST                              (3)

// ============================================================================
// AHB1_RESETS_T
// -----------------------------------------------------------------------------
/// 
// =============================================================================
typedef enum
{
/// AP AHB1 side resets
    AHB1_RST_SYS                                = 0x00000000,
    AHB1_RST_USBC                               = 0x00000001,
    AHB1_RST_SPIFLASH                           = 0x00000002
} AHB1_RESETS_T;

#define NB_AHB1_RST                             (3)

// ============================================================================
// APB1_RESETS_T
// -----------------------------------------------------------------------------
/// 
// =============================================================================
typedef enum
{
/// AP APB1 side resets
    APB1_RST_SYS                                = 0x00000000,
    APB1_RST_TIMER                              = 0x00000001,
    APB1_RST_KEYPAD                             = 0x00000002,
    APB1_RST_GPIO                               = 0x00000003,
    APB1_RST_PWM                                = 0x00000004,
    APB1_RST_AIF                                = 0x00000005,
    APB1_RST_AIF2                               = 0x00000006,
    APB1_RST_AUIFC                              = 0x00000007,
    APB1_RST_I2C1                               = 0x00000008,
    APB1_RST_I2C2                               = 0x00000009,
    APB1_RST_I2C3                               = 0x0000000A,
    APB1_RST_COM_REGS                           = 0x0000000B,
    APB1_RST_DMC                                = 0x0000000C,
    APB1_RST_DDRPHY_P                           = 0x0000000D,
    APB1_RST_BB2G_XCPU                          = 0x0000000E,
    APB1_RST_BB2G_BCPU                          = 0x0000000F,
    APB1_RST_BB2G_AHBC                          = 0x00000010,
    APB1_RST_BB2G_DMA                           = 0x00000011,
    APB1_RST_BB2G_A2A                           = 0x00000012,
    APB1_RST_BB2G_XIFC                          = 0x00000013,
    APB1_RST_BB2G_BIFC                          = 0x00000014,
    APB1_RST_BB2G_BAHBC                         = 0x00000015,
    APB1_RST_BB2G_MEM_BRIDGE                    = 0x00000016
} APB1_RESETS_T;

#define NB_APB1_RST                             (23)

// ============================================================================
// APB2_RESETS_T
// -----------------------------------------------------------------------------
/// 
// =============================================================================
typedef enum
{
/// AP APB2 side resets
    APB2_RST_SYS                                = 0x00000000,
    APB2_RST_IFC                                = 0x00000001,
    APB2_RST_UART1                              = 0x00000002,
    APB2_RST_UART2                              = 0x00000003,
    APB2_RST_UART3                              = 0x00000004,
    APB2_RST_SPI1                               = 0x00000005,
    APB2_RST_SPI2                               = 0x00000006,
    APB2_RST_SPI3                               = 0x00000007,
    APB2_RST_SDMMC1                             = 0x00000008,
    APB2_RST_SDMMC2                             = 0x00000009,
    APB2_RST_SDMMC3                             = 0x0000000A,
    APB2_RST_NANDFLASH                          = 0x0000000B
} APB2_RESETS_T;

#define NB_APB2_RST                             (12)

// ============================================================================
// MEM_RESETS_T
// -----------------------------------------------------------------------------
/// 
// =============================================================================
typedef enum
{
/// AP MEM side resets
    MEM_RST_SYS                                 = 0x00000000,
    MEM_RST_GPU                                 = 0x00000001,
    MEM_RST_VPU                                 = 0x00000002,
    MEM_RST_DMC                                 = 0x00000003,
    MEM_RST_DDRPHY_P                            = 0x00000004
} MEM_RESETS_T;

#define NB_MEM_RST                              (5)

// ============================================================================
// AP_OTHERS_RESETS_T
// -----------------------------------------------------------------------------
/// 
// =============================================================================
typedef enum
{
/// AP Reset Other : resync on corresponding clock other
    AP_RSTO_VOC                                 = 0x00000000,
    AP_RSTO_VOC2                                = 0x00000001,
    AP_RSTO_DDRPHY_N                            = 0x00000002,
    AP_RSTO_DDRPHY2XP                           = 0x00000003,
    AP_RSTO_DDRPHY2XN                           = 0x00000004,
    AP_RSTO_GPU                                 = 0x00000005,
    AP_RSTO_VPU                                 = 0x00000006,
    AP_RSTO_BCK                                 = 0x00000007,
    AP_RSTO_BCK2                                = 0x00000008,
    AP_RSTO_UART1                               = 0x00000009,
    AP_RSTO_UART2                               = 0x0000000A,
    AP_RSTO_UART3                               = 0x0000000B,
    AP_RSTO_GPIO                                = 0x0000000C,
    AP_RSTO_TIMER                               = 0x0000000D,
    AP_RSTO_USBC                                = 0x0000000E,
    AP_RSTO_DSI                                 = 0x0000000F,
    AP_RSTO_SPIFLASH                            = 0x00000010,
    AP_RSTO_TCK                                 = 0x00000011,
    AP_RSTO_PDBG_XTAL                           = 0x00000012
} AP_OTHERS_RESETS_T;

#define NB_AP_RSTO                              (19)
/// For REG_DBG protect lock/unlock value
#define AP_CTRL_PROTECT_LOCK                    (0XA50000)
#define AP_CTRL_PROTECT_UNLOCK                  (0XA50001)

// =============================================================================
//  TYPES
// =============================================================================

// ============================================================================
// SYS_CTRL_AP_T
// -----------------------------------------------------------------------------
/// 
// =============================================================================
typedef volatile struct
{
    /// <strong>This register is used to Lock and Unlock the protected registers.</strong>
    REG32                          REG_DBG;                      //0x00000000
    /// Register protected by Write_Unlocked_H.
    REG32                          Cfg_Pll_Ctrl[4];              //0x00000004
    /// This register is protected.
    REG32                          Sel_Clock;                    //0x00000014
    REG32                          Reset_Cause;                  //0x00000018
    /// This register is protected.
    REG32                          CPU_Rst_Set;                  //0x0000001C
    REG32                          CPU_Rst_Clr;                  //0x00000020
    /// This register is protected.
    REG32                          AXI_Rst_Set;                  //0x00000024
    REG32                          AXI_Rst_Clr;                  //0x00000028
    /// This register is protected.
    REG32                          AXIDIV2_Rst_Set;              //0x0000002C
    REG32                          AXIDIV2_Rst_Clr;              //0x00000030
    /// This register is protected.
    REG32                          GCG_Rst_Set;                  //0x00000034
    REG32                          GCG_Rst_Clr;                  //0x00000038
    /// This register is protected.
    REG32                          AHB1_Rst_Set;                 //0x0000003C
    REG32                          AHB1_Rst_Clr;                 //0x00000040
    /// This register is protected.
    REG32                          APB1_Rst_Set;                 //0x00000044
    REG32                          APB1_Rst_Clr;                 //0x00000048
    /// This register is protected.
    REG32                          APB2_Rst_Set;                 //0x0000004C
    REG32                          APB2_Rst_Clr;                 //0x00000050
    /// This register is protected.
    REG32                          MEM_Rst_Set;                  //0x00000054
    REG32                          MEM_Rst_Clr;                  //0x00000058
    REG32                          Clk_CPU_Mode;                 //0x0000005C
    REG32                          Clk_CPU_Enable;               //0x00000060
    /// This register is protected.
    REG32                          Clk_CPU_Disable;              //0x00000064
    REG32                          Clk_AXI_Mode;                 //0x00000068
    REG32                          Clk_AXI_Enable;               //0x0000006C
    /// This register is protected.
    REG32                          Clk_AXI_Disable;              //0x00000070
    REG32                          Clk_AXIDIV2_Mode;             //0x00000074
    REG32                          Clk_AXIDIV2_Enable;           //0x00000078
    /// This register is protected.
    REG32                          Clk_AXIDIV2_Disable;          //0x0000007C
    REG32                          Clk_GCG_Mode;                 //0x00000080
    REG32                          Clk_GCG_Enable;               //0x00000084
    /// This register is protected.
    REG32                          Clk_GCG_Disable;              //0x00000088
    REG32                          Clk_AHB1_Mode;                //0x0000008C
    REG32                          Clk_AHB1_Enable;              //0x00000090
    /// This register is protected.
    REG32                          Clk_AHB1_Disable;             //0x00000094
    REG32                          Clk_APB1_Mode;                //0x00000098
    REG32                          Clk_APB1_Enable;              //0x0000009C
    /// This register is protected.
    REG32                          Clk_APB1_Disable;             //0x000000A0
    REG32                          Clk_APB2_Mode;                //0x000000A4
    REG32                          Clk_APB2_Enable;              //0x000000A8
    /// This register is protected.
    REG32                          Clk_APB2_Disable;             //0x000000AC
    REG32                          Clk_MEM_Mode;                 //0x000000B0
    REG32                          Clk_MEM_Enable;               //0x000000B4
    /// This register is protected.
    REG32                          Clk_MEM_Disable;              //0x000000B8
    REG32                          Clk_APO_Mode;                 //0x000000BC
    REG32                          Clk_APO_Enable;               //0x000000C0
    /// This register is protected.
    REG32                          Clk_APO_Disable;              //0x000000C4
    REG32                          Cfg_Clk_AP_CPU;               //0x000000C8
    REG32                          Cfg_Clk_AP_AXI;               //0x000000CC
    REG32                          Cfg_Clk_AP_GCG;               //0x000000D0
    REG32                          Cfg_Clk_AP_AHB1;              //0x000000D4
    REG32                          Cfg_Clk_AP_APB1;              //0x000000D8
    REG32                          Cfg_Clk_AP_APB2;              //0x000000DC
    REG32                          Cfg_Clk_AP_MEM;               //0x000000E0
    REG32                          Cfg_Clk_AP_GPU;               //0x000000E4
    REG32                          Cfg_Clk_AP_VPU;               //0x000000E8
    REG32                          Cfg_Clk_AP_VOC;               //0x000000EC
    REG32                          Cfg_Clk_AP_SFLSH;             //0x000000F0
    REG32                          Cfg_Clk_Uart[3];              //0x000000F4
    REG32                          L2cc_Ctrl;                    //0x00000100
    REG32                          Spi_Ctrl;                     //0x00000104
    REG32                          Memory_Margin;                //0x00000108
    REG32                          Memory_Margin2;               //0x0000010C
    REG32                          Memory_Observe;               //0x00000110
    REG32                          Cfg_Clk_AP_VOC2;              //0x00000114
    REG32 Reserved_00000118[57];                //0x00000118
    /// This register is reserved.
    REG32                          Cfg_Reserve;                  //0x000001FC
} HWP_SYS_CTRL_AP_T;

#define hwp_sysCtrlAp              ((HWP_SYS_CTRL_AP_T*)(RDA_SYSCTRL_BASE))


//REG_DBG
#define SYS_CTRL_AP_SCRATCH(n)     (((n)&0xFFFF)<<0)
#define SYS_CTRL_AP_WRITE_UNLOCK_STATUS (1<<30)
#define SYS_CTRL_AP_WRITE_UNLOCK   (1<<31)

//Cfg_Pll_Ctrl
#define SYS_CTRL_AP_AP_PLL_ENABLE  (1<<0)
#define SYS_CTRL_AP_AP_PLL_ENABLE_MASK (1<<0)
#define SYS_CTRL_AP_AP_PLL_ENABLE_SHIFT (0)
#define SYS_CTRL_AP_AP_PLL_ENABLE_POWER_DOWN (0<<0)
#define SYS_CTRL_AP_AP_PLL_ENABLE_ENABLE (1<<0)
#define SYS_CTRL_AP_AP_PLL_LOCK_RESET (1<<4)
#define SYS_CTRL_AP_AP_PLL_LOCK_RESET_MASK (1<<4)
#define SYS_CTRL_AP_AP_PLL_LOCK_RESET_SHIFT (4)
#define SYS_CTRL_AP_AP_PLL_LOCK_RESET_RESET (0<<4)
#define SYS_CTRL_AP_AP_PLL_LOCK_RESET_NO_RESET (1<<4)
#define SYS_CTRL_AP_AP_PLL_BYPASS  (1<<8)
#define SYS_CTRL_AP_AP_PLL_BYPASS_MASK (1<<8)
#define SYS_CTRL_AP_AP_PLL_BYPASS_SHIFT (8)
#define SYS_CTRL_AP_AP_PLL_BYPASS_PASS (0<<8)
#define SYS_CTRL_AP_AP_PLL_BYPASS_BYPASS (1<<8)
#define SYS_CTRL_AP_AP_PLL_CLK_FAST_ENABLE (1<<12)
#define SYS_CTRL_AP_AP_PLL_CLK_FAST_ENABLE_MASK (1<<12)
#define SYS_CTRL_AP_AP_PLL_CLK_FAST_ENABLE_SHIFT (12)
#define SYS_CTRL_AP_AP_PLL_CLK_FAST_ENABLE_ENABLE (1<<12)
#define SYS_CTRL_AP_AP_PLL_CLK_FAST_ENABLE_DISABLE (0<<12)
#define SYS_CTRL_AP_AP_PLL_LOCK_NUM_LOW(n) (((n)&31)<<16)
#define SYS_CTRL_AP_AP_PLL_LOCK_NUM_LOW_MASK (31<<16)
#define SYS_CTRL_AP_AP_PLL_LOCK_NUM_LOW_SHIFT (16)
#define SYS_CTRL_AP_AP_PLL_LOCK_NUM_HIGH(n) (((n)&31)<<24)
#define SYS_CTRL_AP_AP_PLL_LOCK_NUM_HIGH_MASK (31<<24)
#define SYS_CTRL_AP_AP_PLL_LOCK_NUM_HIGH_SHIFT (24)
#define SYS_CTRL_AP_PLL_AP_CFG(n)  (((n)&0x1F1F1111)<<0)
#define SYS_CTRL_AP_PLL_AP_CFG_MASK (0x1F1F1111<<0)
#define SYS_CTRL_AP_PLL_AP_CFG_SHIFT (0)

//Sel_Clock
#define SYS_CTRL_AP_SLOW_SEL_RF_OSCILLATOR (1<<0)
#define SYS_CTRL_AP_SLOW_SEL_RF_RF (0<<0)
#define SYS_CTRL_AP_CPU_SEL_FAST_SLOW (1<<4)
#define SYS_CTRL_AP_CPU_SEL_FAST_FAST (0<<4)
#define SYS_CTRL_AP_BUS_SEL_FAST_SLOW (1<<5)
#define SYS_CTRL_AP_BUS_SEL_FAST_FAST (0<<5)
#define SYS_CTRL_AP_TIMER_SEL_FAST_SLOW (1<<7)
#define SYS_CTRL_AP_TIMER_SEL_FAST_FAST (0<<7)
#define SYS_CTRL_AP_RF_DETECTED_OK (1<<8)
#define SYS_CTRL_AP_RF_DETECTED_NO (0<<8)
#define SYS_CTRL_AP_RF_DETECT_BYPASS (1<<9)
#define SYS_CTRL_AP_RF_DETECT_RESET (1<<10)
#define SYS_CTRL_AP_RF_SELECTED_L  (1<<11)
#define SYS_CTRL_AP_PLL_LOCKED_CPU (1<<12)
#define SYS_CTRL_AP_PLL_LOCKED_CPU_MASK (1<<12)
#define SYS_CTRL_AP_PLL_LOCKED_CPU_SHIFT (12)
#define SYS_CTRL_AP_PLL_LOCKED_CPU_LOCKED (1<<12)
#define SYS_CTRL_AP_PLL_LOCKED_CPU_NOT_LOCKED (0<<12)
#define SYS_CTRL_AP_PLL_LOCKED_BUS (1<<13)
#define SYS_CTRL_AP_PLL_LOCKED_BUS_MASK (1<<13)
#define SYS_CTRL_AP_PLL_LOCKED_BUS_SHIFT (13)
#define SYS_CTRL_AP_PLL_LOCKED_BUS_LOCKED (1<<13)
#define SYS_CTRL_AP_PLL_LOCKED_BUS_NOT_LOCKED (0<<13)
#define SYS_CTRL_AP_PLL_LOCKED_MEM (1<<14)
#define SYS_CTRL_AP_PLL_LOCKED_MEM_MASK (1<<14)
#define SYS_CTRL_AP_PLL_LOCKED_MEM_SHIFT (14)
#define SYS_CTRL_AP_PLL_LOCKED_MEM_LOCKED (1<<14)
#define SYS_CTRL_AP_PLL_LOCKED_MEM_NOT_LOCKED (0<<14)
#define SYS_CTRL_AP_PLL_LOCKED_USB (1<<15)
#define SYS_CTRL_AP_PLL_LOCKED_USB_MASK (1<<15)
#define SYS_CTRL_AP_PLL_LOCKED_USB_SHIFT (15)
#define SYS_CTRL_AP_PLL_LOCKED_USB_LOCKED (1<<15)
#define SYS_CTRL_AP_PLL_LOCKED_USB_NOT_LOCKED (0<<15)
#define SYS_CTRL_AP_PLL_BYPASS_LOCK_CPU (1<<20)
#define SYS_CTRL_AP_PLL_BYPASS_LOCK_BUS (1<<21)
#define SYS_CTRL_AP_FAST_SELECTED_CPU_L (1<<30)
#define SYS_CTRL_AP_FAST_SELECTED_CPU_L_MASK (1<<30)
#define SYS_CTRL_AP_FAST_SELECTED_CPU_L_SHIFT (30)
#define SYS_CTRL_AP_FAST_SELECTED_BUS_L (1<<31)
#define SYS_CTRL_AP_FAST_SELECTED_BUS_L_MASK (1<<31)
#define SYS_CTRL_AP_FAST_SELECTED_BUS_L_SHIFT (31)

//Reset_Cause
#define SYS_CTRL_AP_WATCHDOG_RESET_HAPPENED (1<<0)
#define SYS_CTRL_AP_WATCHDOG_RESET_NO (0<<0)
#define SYS_CTRL_AP_GLOBALSOFT_RESET_HAPPENED (1<<4)
#define SYS_CTRL_AP_GLOBALSOFT_RESET_NO (0<<4)
#define SYS_CTRL_AP_HOSTDEBUG_RESET_HAPPENED (1<<5)
#define SYS_CTRL_AP_HOSTDEBUG_RESET_NO (0<<5)
#define SYS_CTRL_AP_ALARMCAUSE_HAPPENED (1<<6)
#define SYS_CTRL_AP_ALARMCAUSE_NO  (0<<6)
#define SYS_CTRL_AP_BOOT_MODE(n)   (((n)&0xFFFF)<<8)
#define SYS_CTRL_AP_BOOT_MODE_MASK (0xFFFF<<8)
#define SYS_CTRL_AP_BOOT_MODE_SHIFT (8)
#define SYS_CTRL_AP_SW_BOOT_MODE(n) (((n)&0x7F)<<24)
#define SYS_CTRL_AP_SW_BOOT_MODE_MASK (0x7F<<24)
#define SYS_CTRL_AP_SW_BOOT_MODE_SHIFT (24)
#define SYS_CTRL_AP_FONCTIONAL_TEST_MODE (1<<31)

//CPU_Rst_Set
#define SYS_CTRL_AP_SET_CPU_RST_CORE (1<<0)
#define SYS_CTRL_AP_SET_CPU_RST_SYS (1<<1)
#define SYS_CTRL_AP_SOFT_RST       (1<<31)
#define SYS_CTRL_AP_SET_CPU_RST(n) (((n)&3)<<0)
#define SYS_CTRL_AP_SET_CPU_RST_MASK (3<<0)
#define SYS_CTRL_AP_SET_CPU_RST_SHIFT (0)

//CPU_Rst_Clr
#define SYS_CTRL_AP_CLR_CPU_RST_CORE (1<<0)
#define SYS_CTRL_AP_CLR_CPU_RST_SYS (1<<1)
#define SYS_CTRL_AP_CLR_CPU_RST(n) (((n)&3)<<0)
#define SYS_CTRL_AP_CLR_CPU_RST_MASK (3<<0)
#define SYS_CTRL_AP_CLR_CPU_RST_SHIFT (0)

//AXI_Rst_Set
#define SYS_CTRL_AP_SET_AXI_RST_VOC (1<<0)
#define SYS_CTRL_AP_SET_AXI_RST_VOC2 (1<<1)
#define SYS_CTRL_AP_SET_AXI_RST_DMA (1<<2)
#define SYS_CTRL_AP_SET_AXI_RST_SYS (1<<3)
#define SYS_CTRL_AP_SET_AXI_RST_CONNECT (1<<4)
#define SYS_CTRL_AP_SET_AHB0_RST_GPU (1<<5)
#define SYS_CTRL_AP_SET_APB0_RST_VPU (1<<6)
#define SYS_CTRL_AP_SET_APB0_RST_IRQ (1<<7)
#define SYS_CTRL_AP_SET_AXI_RST(n) (((n)&0xFF)<<0)
#define SYS_CTRL_AP_SET_AXI_RST_MASK (0xFF<<0)
#define SYS_CTRL_AP_SET_AXI_RST_SHIFT (0)

//AXI_Rst_Clr
#define SYS_CTRL_AP_CLR_AXI_RST_VOC (1<<0)
#define SYS_CTRL_AP_CLR_AXI_RST_VOC2 (1<<1)
#define SYS_CTRL_AP_CLR_AXI_RST_DMA (1<<2)
#define SYS_CTRL_AP_CLR_AXI_RST_SYS (1<<3)
#define SYS_CTRL_AP_CLR_AXI_RST_CONNECT (1<<4)
#define SYS_CTRL_AP_CLR_AHB0_RST_GPU (1<<5)
#define SYS_CTRL_AP_CLR_APB0_RST_VPU (1<<6)
#define SYS_CTRL_AP_CLR_APB0_RST_IRQ (1<<7)
#define SYS_CTRL_AP_CLR_AXI_RST(n) (((n)&0xFF)<<0)
#define SYS_CTRL_AP_CLR_AXI_RST_MASK (0xFF<<0)
#define SYS_CTRL_AP_CLR_AXI_RST_SHIFT (0)

//AXIDIV2_Rst_Set
#define SYS_CTRL_AP_SET_AXIDIV2_RST_IMEM (1<<0)
#define SYS_CTRL_AP_SET_AXIDIV2_RST_SYS (1<<1)
#define SYS_CTRL_AP_SET_AXIDIV2_RST_VPU (1<<2)
#define SYS_CTRL_AP_SET_AXIDIV2_RST(n) (((n)&7)<<0)
#define SYS_CTRL_AP_SET_AXIDIV2_RST_MASK (7<<0)
#define SYS_CTRL_AP_SET_AXIDIV2_RST_SHIFT (0)

//AXIDIV2_Rst_Clr
#define SYS_CTRL_AP_CLR_AXIDIV2_RST_IMEM (1<<0)
#define SYS_CTRL_AP_CLR_AXIDIV2_RST_SYS (1<<1)
#define SYS_CTRL_AP_CLR_AXIDIV2_RST_VPU (1<<2)
#define SYS_CTRL_AP_CLR_AXIDIV2_RST(n) (((n)&7)<<0)
#define SYS_CTRL_AP_CLR_AXIDIV2_RST_MASK (7<<0)
#define SYS_CTRL_AP_CLR_AXIDIV2_RST_SHIFT (0)

//GCG_Rst_Set
#define SYS_CTRL_AP_SET_GCG_RST_SYS (1<<0)
#define SYS_CTRL_AP_SET_GCG_RST_GOUDA (1<<1)
#define SYS_CTRL_AP_SET_GCG_RST_CAMERA (1<<2)
#define SYS_CTRL_AP_SET_GCG_RST(n) (((n)&7)<<0)
#define SYS_CTRL_AP_SET_GCG_RST_MASK (7<<0)
#define SYS_CTRL_AP_SET_GCG_RST_SHIFT (0)

//GCG_Rst_Clr
#define SYS_CTRL_AP_CLR_GCG_RST_SYS (1<<0)
#define SYS_CTRL_AP_CLR_GCG_RST_GOUDA (1<<1)
#define SYS_CTRL_AP_CLR_GCG_RST_CAMERA (1<<2)
#define SYS_CTRL_AP_CLR_GCG_RST(n) (((n)&7)<<0)
#define SYS_CTRL_AP_CLR_GCG_RST_MASK (7<<0)
#define SYS_CTRL_AP_CLR_GCG_RST_SHIFT (0)

//AHB1_Rst_Set
#define SYS_CTRL_AP_SET_AHB1_RST_SYS (1<<0)
#define SYS_CTRL_AP_SET_AHB1_RST_USBC (1<<1)
#define SYS_CTRL_AP_SET_AHB1_RST_SPIFLASH (1<<2)
#define SYS_CTRL_AP_SET_AHB1_RST(n) (((n)&7)<<0)
#define SYS_CTRL_AP_SET_AHB1_RST_MASK (7<<0)
#define SYS_CTRL_AP_SET_AHB1_RST_SHIFT (0)

//AHB1_Rst_Clr
#define SYS_CTRL_AP_CLR_AHB1_RST_SYS (1<<0)
#define SYS_CTRL_AP_CLR_AHB1_RST_USBC (1<<1)
#define SYS_CTRL_AP_CLR_AHB1_RST_SPIFLASH (1<<2)
#define SYS_CTRL_AP_CLR_AHB1_RST(n) (((n)&7)<<0)
#define SYS_CTRL_AP_CLR_AHB1_RST_MASK (7<<0)
#define SYS_CTRL_AP_CLR_AHB1_RST_SHIFT (0)

//APB1_Rst_Set
#define SYS_CTRL_AP_SET_APB1_RST_SYS (1<<0)
#define SYS_CTRL_AP_SET_APB1_RST_TIMER (1<<1)
#define SYS_CTRL_AP_SET_APB1_RST_KEYPAD (1<<2)
#define SYS_CTRL_AP_SET_APB1_RST_GPIO (1<<3)
#define SYS_CTRL_AP_SET_APB1_RST_PWM (1<<4)
#define SYS_CTRL_AP_SET_APB1_RST_AIF (1<<5)
#define SYS_CTRL_AP_SET_APB1_RST_AIF2 (1<<6)
#define SYS_CTRL_AP_SET_APB1_RST_AUIFC (1<<7)
#define SYS_CTRL_AP_SET_APB1_RST_I2C1 (1<<8)
#define SYS_CTRL_AP_SET_APB1_RST_I2C2 (1<<9)
#define SYS_CTRL_AP_SET_APB1_RST_I2C3 (1<<10)
#define SYS_CTRL_AP_SET_APB1_RST_COM_REGS (1<<11)
#define SYS_CTRL_AP_SET_APB1_RST_DMC (1<<12)
#define SYS_CTRL_AP_SET_APB1_RST_DDRPHY_P (1<<13)
#define SYS_CTRL_AP_SET_APB1_RST_BB2G_XCPU (1<<14)
#define SYS_CTRL_AP_SET_APB1_RST_BB2G_BCPU (1<<15)
#define SYS_CTRL_AP_SET_APB1_RST_BB2G_AHBC (1<<16)
#define SYS_CTRL_AP_SET_APB1_RST_BB2G_DMA (1<<17)
#define SYS_CTRL_AP_SET_APB1_RST_BB2G_A2A (1<<18)
#define SYS_CTRL_AP_SET_APB1_RST_BB2G_XIFC (1<<19)
#define SYS_CTRL_AP_SET_APB1_RST_BB2G_BIFC (1<<20)
#define SYS_CTRL_AP_SET_APB1_RST_BB2G_BAHBC (1<<21)
#define SYS_CTRL_AP_SET_APB1_RST_BB2G_MEM_BRIDGE (1<<22)
#define SYS_CTRL_AP_SET_APB1_RST(n) (((n)&0x7FFFFF)<<0)
#define SYS_CTRL_AP_SET_APB1_RST_MASK (0x7FFFFF<<0)
#define SYS_CTRL_AP_SET_APB1_RST_SHIFT (0)

//APB1_Rst_Clr
#define SYS_CTRL_AP_CLR_APB1_RST_SYS (1<<0)
#define SYS_CTRL_AP_CLR_APB1_RST_TIMER (1<<1)
#define SYS_CTRL_AP_CLR_APB1_RST_KEYPAD (1<<2)
#define SYS_CTRL_AP_CLR_APB1_RST_GPIO (1<<3)
#define SYS_CTRL_AP_CLR_APB1_RST_PWM (1<<4)
#define SYS_CTRL_AP_CLR_APB1_RST_AIF (1<<5)
#define SYS_CTRL_AP_CLR_APB1_RST_AIF2 (1<<6)
#define SYS_CTRL_AP_CLR_APB1_RST_AUIFC (1<<7)
#define SYS_CTRL_AP_CLR_APB1_RST_I2C1 (1<<8)
#define SYS_CTRL_AP_CLR_APB1_RST_I2C2 (1<<9)
#define SYS_CTRL_AP_CLR_APB1_RST_I2C3 (1<<10)
#define SYS_CTRL_AP_CLR_APB1_RST_COM_REGS (1<<11)
#define SYS_CTRL_AP_CLR_APB1_RST_DMC (1<<12)
#define SYS_CTRL_AP_CLR_APB1_RST_DDRPHY_P (1<<13)
#define SYS_CTRL_AP_CLR_APB1_RST_BB2G_XCPU (1<<14)
#define SYS_CTRL_AP_CLR_APB1_RST_BB2G_BCPU (1<<15)
#define SYS_CTRL_AP_CLR_APB1_RST_BB2G_AHBC (1<<16)
#define SYS_CTRL_AP_CLR_APB1_RST_BB2G_DMA (1<<17)
#define SYS_CTRL_AP_CLR_APB1_RST_BB2G_A2A (1<<18)
#define SYS_CTRL_AP_CLR_APB1_RST_BB2G_XIFC (1<<19)
#define SYS_CTRL_AP_CLR_APB1_RST_BB2G_BIFC (1<<20)
#define SYS_CTRL_AP_CLR_APB1_RST_BB2G_BAHBC (1<<21)
#define SYS_CTRL_AP_CLR_APB1_RST_BB2G_MEM_BRIDGE (1<<22)
#define SYS_CTRL_AP_CLR_APB1_RST(n) (((n)&0x7FFFFF)<<0)
#define SYS_CTRL_AP_CLR_APB1_RST_MASK (0x7FFFFF<<0)
#define SYS_CTRL_AP_CLR_APB1_RST_SHIFT (0)

//APB2_Rst_Set
#define SYS_CTRL_AP_SET_APB2_RST_SYS (1<<0)
#define SYS_CTRL_AP_SET_APB2_RST_IFC (1<<1)
#define SYS_CTRL_AP_SET_APB2_RST_UART1 (1<<2)
#define SYS_CTRL_AP_SET_APB2_RST_UART2 (1<<3)
#define SYS_CTRL_AP_SET_APB2_RST_UART3 (1<<4)
#define SYS_CTRL_AP_SET_APB2_RST_SPI1 (1<<5)
#define SYS_CTRL_AP_SET_APB2_RST_SPI2 (1<<6)
#define SYS_CTRL_AP_SET_APB2_RST_SPI3 (1<<7)
#define SYS_CTRL_AP_SET_APB2_RST_SDMMC1 (1<<8)
#define SYS_CTRL_AP_SET_APB2_RST_SDMMC2 (1<<9)
#define SYS_CTRL_AP_SET_APB2_RST_SDMMC3 (1<<10)
#define SYS_CTRL_AP_SET_APB2_RST_NANDFLASH (1<<11)
#define SYS_CTRL_AP_SET_APB2_RST(n) (((n)&0xFFF)<<0)
#define SYS_CTRL_AP_SET_APB2_RST_MASK (0xFFF<<0)
#define SYS_CTRL_AP_SET_APB2_RST_SHIFT (0)

//APB2_Rst_Clr
#define SYS_CTRL_AP_CLR_APB2_RST_SYS (1<<0)
#define SYS_CTRL_AP_CLR_APB2_RST_IFC (1<<1)
#define SYS_CTRL_AP_CLR_APB2_RST_UART1 (1<<2)
#define SYS_CTRL_AP_CLR_APB2_RST_UART2 (1<<3)
#define SYS_CTRL_AP_CLR_APB2_RST_UART3 (1<<4)
#define SYS_CTRL_AP_CLR_APB2_RST_SPI1 (1<<5)
#define SYS_CTRL_AP_CLR_APB2_RST_SPI2 (1<<6)
#define SYS_CTRL_AP_CLR_APB2_RST_SPI3 (1<<7)
#define SYS_CTRL_AP_CLR_APB2_RST_SDMMC1 (1<<8)
#define SYS_CTRL_AP_CLR_APB2_RST_SDMMC2 (1<<9)
#define SYS_CTRL_AP_CLR_APB2_RST_SDMMC3 (1<<10)
#define SYS_CTRL_AP_CLR_APB2_RST_NANDFLASH (1<<11)
#define SYS_CTRL_AP_CLR_APB2_RST(n) (((n)&0xFFF)<<0)
#define SYS_CTRL_AP_CLR_APB2_RST_MASK (0xFFF<<0)
#define SYS_CTRL_AP_CLR_APB2_RST_SHIFT (0)

//MEM_Rst_Set
#define SYS_CTRL_AP_SET_MEM_RST_SYS (1<<0)
#define SYS_CTRL_AP_SET_MEM_RST_GPU (1<<1)
#define SYS_CTRL_AP_SET_MEM_RST_VPU (1<<2)
#define SYS_CTRL_AP_SET_MEM_RST_DMC (1<<3)
#define SYS_CTRL_AP_SET_MEM_RST_DDRPHY_P (1<<4)
#define SYS_CTRL_AP_SET_MEM_RST(n) (((n)&31)<<0)
#define SYS_CTRL_AP_SET_MEM_RST_MASK (31<<0)
#define SYS_CTRL_AP_SET_MEM_RST_SHIFT (0)

//MEM_Rst_Clr
#define SYS_CTRL_AP_CLR_MEM_RST_SYS (1<<0)
#define SYS_CTRL_AP_CLR_MEM_RST_GPU (1<<1)
#define SYS_CTRL_AP_CLR_MEM_RST_VPU (1<<2)
#define SYS_CTRL_AP_CLR_MEM_RST_DMC (1<<3)
#define SYS_CTRL_AP_CLR_MEM_RST_DDRPHY_P (1<<4)
#define SYS_CTRL_AP_CLR_MEM_RST(n) (((n)&31)<<0)
#define SYS_CTRL_AP_CLR_MEM_RST_MASK (31<<0)
#define SYS_CTRL_AP_CLR_MEM_RST_SHIFT (0)

//Clk_CPU_Mode
#define SYS_CTRL_AP_MODE_CLK_CPU_AUTOMATIC (0<<0)
#define SYS_CTRL_AP_MODE_CLK_CPU_MANUAL (1<<0)

//Clk_CPU_Enable
#define SYS_CTRL_AP_ENABLE_CPU_CORE (1<<0)
#define SYS_CTRL_AP_ENABLE_CPU_DUMMY (1<<1)
#define SYS_CTRL_AP_ENABLE_CLK_CPU(n) (((n)&3)<<0)
#define SYS_CTRL_AP_ENABLE_CLK_CPU_MASK (3<<0)
#define SYS_CTRL_AP_ENABLE_CLK_CPU_SHIFT (0)

//Clk_CPU_Disable
#define SYS_CTRL_AP_DISABLE_CPU_CORE (1<<0)
#define SYS_CTRL_AP_DISABLE_CPU_DUMMY (1<<1)
#define SYS_CTRL_AP_DISABLE_CLK_CPU(n) (((n)&3)<<0)
#define SYS_CTRL_AP_DISABLE_CLK_CPU_MASK (3<<0)
#define SYS_CTRL_AP_DISABLE_CLK_CPU_SHIFT (0)

//Clk_AXI_Mode
#define SYS_CTRL_AP_MODE_AHB0_CONF_AUTOMATIC (0<<0)
#define SYS_CTRL_AP_MODE_AHB0_CONF_MANUAL (1<<0)
#define SYS_CTRL_AP_MODE_APB0_CONF_AUTOMATIC (0<<1)
#define SYS_CTRL_AP_MODE_APB0_CONF_MANUAL (1<<1)
#define SYS_CTRL_AP_MODE_AXI_VOC_AUTOMATIC (0<<2)
#define SYS_CTRL_AP_MODE_AXI_VOC_MANUAL (1<<2)
#define SYS_CTRL_AP_MODE_AXI_VOC2_AUTOMATIC (0<<3)
#define SYS_CTRL_AP_MODE_AXI_VOC2_MANUAL (1<<3)
#define SYS_CTRL_AP_MODE_AXI_DMA_AUTOMATIC (0<<4)
#define SYS_CTRL_AP_MODE_AXI_DMA_MANUAL (1<<4)
#define SYS_CTRL_AP_MODE_CLK_AXI(n) (((n)&31)<<0)
#define SYS_CTRL_AP_MODE_CLK_AXI_MASK (31<<0)
#define SYS_CTRL_AP_MODE_CLK_AXI_SHIFT (0)

//Clk_AXI_Enable
#define SYS_CTRL_AP_ENABLE_AHB0_CONF (1<<0)
#define SYS_CTRL_AP_ENABLE_APB0_CONF (1<<1)
#define SYS_CTRL_AP_ENABLE_AXI_VOC (1<<2)
#define SYS_CTRL_AP_ENABLE_AXI_VOC2 (1<<3)
#define SYS_CTRL_AP_ENABLE_AXI_DMA (1<<4)
#define SYS_CTRL_AP_ENABLE_AXI_ALWAYS (1<<5)
#define SYS_CTRL_AP_ENABLE_AXI_CONNECT (1<<6)
#define SYS_CTRL_AP_ENABLE_APB0_IRQ (1<<7)
#define SYS_CTRL_AP_ENABLE_CLK_AXI(n) (((n)&0xFF)<<0)
#define SYS_CTRL_AP_ENABLE_CLK_AXI_MASK (0xFF<<0)
#define SYS_CTRL_AP_ENABLE_CLK_AXI_SHIFT (0)

//Clk_AXI_Disable
#define SYS_CTRL_AP_DISABLE_AHB0_CONF (1<<0)
#define SYS_CTRL_AP_DISABLE_APB0_CONF (1<<1)
#define SYS_CTRL_AP_DISABLE_AXI_VOC (1<<2)
#define SYS_CTRL_AP_DISABLE_AXI_VOC2 (1<<3)
#define SYS_CTRL_AP_DISABLE_AXI_DMA (1<<4)
#define SYS_CTRL_AP_DISABLE_AXI_ALWAYS (1<<5)
#define SYS_CTRL_AP_DISABLE_AXI_CONNECT (1<<6)
#define SYS_CTRL_AP_DISABLE_APB0_IRQ (1<<7)
#define SYS_CTRL_AP_DISABLE_CLK_AXI(n) (((n)&0xFF)<<0)
#define SYS_CTRL_AP_DISABLE_CLK_AXI_MASK (0xFF<<0)
#define SYS_CTRL_AP_DISABLE_CLK_AXI_SHIFT (0)

//Clk_AXIDIV2_Mode
#define SYS_CTRL_AP_MODE_CLK_AXIDIV2_AUTOMATIC (0<<0)
#define SYS_CTRL_AP_MODE_CLK_AXIDIV2_MANUAL (1<<0)

//Clk_AXIDIV2_Enable
#define SYS_CTRL_AP_ENABLE_AXIDIV2_IMEM (1<<0)
#define SYS_CTRL_AP_ENABLE_AXIDIV2_ALWAYS (1<<1)
#define SYS_CTRL_AP_ENABLE_AXIDIV2_CONNECT (1<<2)
#define SYS_CTRL_AP_ENABLE_AXIDIV2_VPU (1<<3)
#define SYS_CTRL_AP_ENABLE_CLK_AXIDIV2(n) (((n)&15)<<0)
#define SYS_CTRL_AP_ENABLE_CLK_AXIDIV2_MASK (15<<0)
#define SYS_CTRL_AP_ENABLE_CLK_AXIDIV2_SHIFT (0)

//Clk_AXIDIV2_Disable
#define SYS_CTRL_AP_DISABLE_AXIDIV2_IMEM (1<<0)
#define SYS_CTRL_AP_DISABLE_AXIDIV2_ALWAYS (1<<1)
#define SYS_CTRL_AP_DISABLE_AXIDIV2_CONNECT (1<<2)
#define SYS_CTRL_AP_DISABLE_AXIDIV2_VPU (1<<3)
#define SYS_CTRL_AP_DISABLE_CLK_AXIDIV2(n) (((n)&15)<<0)
#define SYS_CTRL_AP_DISABLE_CLK_AXIDIV2_MASK (15<<0)
#define SYS_CTRL_AP_DISABLE_CLK_AXIDIV2_SHIFT (0)

//Clk_GCG_Mode
#define SYS_CTRL_AP_MODE_GCG_APB_CONF_AUTOMATIC (0<<0)
#define SYS_CTRL_AP_MODE_GCG_APB_CONF_MANUAL (1<<0)
#define SYS_CTRL_AP_MODE_GCG_GOUDA_AUTOMATIC (0<<1)
#define SYS_CTRL_AP_MODE_GCG_GOUDA_MANUAL (1<<1)
#define SYS_CTRL_AP_MODE_GCG_CAMERA_AUTOMATIC (0<<2)
#define SYS_CTRL_AP_MODE_GCG_CAMERA_MANUAL (1<<2)
#define SYS_CTRL_AP_MODE_CLK_GCG(n) (((n)&7)<<0)
#define SYS_CTRL_AP_MODE_CLK_GCG_MASK (7<<0)
#define SYS_CTRL_AP_MODE_CLK_GCG_SHIFT (0)

//Clk_GCG_Enable
#define SYS_CTRL_AP_ENABLE_GCG_APB_CONF (1<<0)
#define SYS_CTRL_AP_ENABLE_GCG_GOUDA (1<<1)
#define SYS_CTRL_AP_ENABLE_GCG_CAMERA (1<<2)
#define SYS_CTRL_AP_ENABLE_GCG_ALWAYS (1<<3)
#define SYS_CTRL_AP_ENABLE_GCG_CONNECT (1<<4)
#define SYS_CTRL_AP_ENABLE_CLK_GCG(n) (((n)&31)<<0)
#define SYS_CTRL_AP_ENABLE_CLK_GCG_MASK (31<<0)
#define SYS_CTRL_AP_ENABLE_CLK_GCG_SHIFT (0)

//Clk_GCG_Disable
#define SYS_CTRL_AP_DISABLE_GCG_APB_CONF (1<<0)
#define SYS_CTRL_AP_DISABLE_GCG_GOUDA (1<<1)
#define SYS_CTRL_AP_DISABLE_GCG_CAMERA (1<<2)
#define SYS_CTRL_AP_DISABLE_GCG_ALWAYS (1<<3)
#define SYS_CTRL_AP_DISABLE_GCG_CONNECT (1<<4)
#define SYS_CTRL_AP_DISABLE_CLK_GCG(n) (((n)&31)<<0)
#define SYS_CTRL_AP_DISABLE_CLK_GCG_MASK (31<<0)
#define SYS_CTRL_AP_DISABLE_CLK_GCG_SHIFT (0)

//Clk_AHB1_Mode
#define SYS_CTRL_AP_MODE_CLK_AHB1_AUTOMATIC (0<<0)
#define SYS_CTRL_AP_MODE_CLK_AHB1_MANUAL (1<<0)

//Clk_AHB1_Enable
#define SYS_CTRL_AP_ENABLE_AHB1_USBC (1<<0)
#define SYS_CTRL_AP_ENABLE_AHB1_ALWAYS (1<<1)
#define SYS_CTRL_AP_ENABLE_AHB1_SPIFLASH (1<<2)
#define SYS_CTRL_AP_ENABLE_CLK_AHB1(n) (((n)&7)<<0)
#define SYS_CTRL_AP_ENABLE_CLK_AHB1_MASK (7<<0)
#define SYS_CTRL_AP_ENABLE_CLK_AHB1_SHIFT (0)

//Clk_AHB1_Disable
#define SYS_CTRL_AP_DISABLE_AHB1_USBC (1<<0)
#define SYS_CTRL_AP_DISABLE_AHB1_ALWAYS (1<<1)
#define SYS_CTRL_AP_DISABLE_AHB1_SPIFLASH (1<<2)
#define SYS_CTRL_AP_DISABLE_CLK_AHB1(n) (((n)&7)<<0)
#define SYS_CTRL_AP_DISABLE_CLK_AHB1_MASK (7<<0)
#define SYS_CTRL_AP_DISABLE_CLK_AHB1_SHIFT (0)

//Clk_APB1_Mode
#define SYS_CTRL_AP_MODE_APB1_CONF_AUTOMATIC (0<<0)
#define SYS_CTRL_AP_MODE_APB1_CONF_MANUAL (1<<0)
#define SYS_CTRL_AP_MODE_APB1_AIF_AUTOMATIC (0<<1)
#define SYS_CTRL_AP_MODE_APB1_AIF_MANUAL (1<<1)
#define SYS_CTRL_AP_MODE_APB1_AIF2_AUTOMATIC (0<<2)
#define SYS_CTRL_AP_MODE_APB1_AIF2_MANUAL (1<<2)
#define SYS_CTRL_AP_MODE_APB1_AUIFC_AUTOMATIC (0<<3)
#define SYS_CTRL_AP_MODE_APB1_AUIFC_MANUAL (1<<3)
#define SYS_CTRL_AP_MODE_APB1_AUIFC_CH0_AUTOMATIC (0<<4)
#define SYS_CTRL_AP_MODE_APB1_AUIFC_CH0_MANUAL (1<<4)
#define SYS_CTRL_AP_MODE_APB1_AUIFC_CH1_AUTOMATIC (0<<5)
#define SYS_CTRL_AP_MODE_APB1_AUIFC_CH1_MANUAL (1<<5)
#define SYS_CTRL_AP_MODE_APB1_AUIFC_CH2_AUTOMATIC (0<<6)
#define SYS_CTRL_AP_MODE_APB1_AUIFC_CH2_MANUAL (1<<6)
#define SYS_CTRL_AP_MODE_APB1_AUIFC_CH3_AUTOMATIC (0<<7)
#define SYS_CTRL_AP_MODE_APB1_AUIFC_CH3_MANUAL (1<<7)
#define SYS_CTRL_AP_MODE_APB1_I2C1_AUTOMATIC (0<<8)
#define SYS_CTRL_AP_MODE_APB1_I2C1_MANUAL (1<<8)
#define SYS_CTRL_AP_MODE_APB1_I2C2_AUTOMATIC (0<<9)
#define SYS_CTRL_AP_MODE_APB1_I2C2_MANUAL (1<<9)
#define SYS_CTRL_AP_MODE_APB1_I2C3_AUTOMATIC (0<<10)
#define SYS_CTRL_AP_MODE_APB1_I2C3_MANUAL (1<<10)
#define SYS_CTRL_AP_MODE_APB1D_OSC_AUTOMATIC (0<<11)
#define SYS_CTRL_AP_MODE_APB1D_OSC_MANUAL (1<<11)
#define SYS_CTRL_AP_MODE_APB1D_PWM_AUTOMATIC (0<<12)
#define SYS_CTRL_AP_MODE_APB1D_PWM_MANUAL (1<<12)
#define SYS_CTRL_AP_MODE_CLK_APB1(n) (((n)&0x1FFF)<<0)
#define SYS_CTRL_AP_MODE_CLK_APB1_MASK (0x1FFF<<0)
#define SYS_CTRL_AP_MODE_CLK_APB1_SHIFT (0)

//Clk_APB1_Enable
#define SYS_CTRL_AP_ENABLE_APB1_CONF (1<<0)
#define SYS_CTRL_AP_ENABLE_APB1_AIF (1<<1)
#define SYS_CTRL_AP_ENABLE_APB1_AIF2 (1<<2)
#define SYS_CTRL_AP_ENABLE_APB1_AUIFC (1<<3)
#define SYS_CTRL_AP_ENABLE_APB1_AUIFC_CH0 (1<<4)
#define SYS_CTRL_AP_ENABLE_APB1_AUIFC_CH1 (1<<5)
#define SYS_CTRL_AP_ENABLE_APB1_AUIFC_CH2 (1<<6)
#define SYS_CTRL_AP_ENABLE_APB1_AUIFC_CH3 (1<<7)
#define SYS_CTRL_AP_ENABLE_APB1_I2C1 (1<<8)
#define SYS_CTRL_AP_ENABLE_APB1_I2C2 (1<<9)
#define SYS_CTRL_AP_ENABLE_APB1_I2C3 (1<<10)
#define SYS_CTRL_AP_ENABLE_APB1D_OSC (1<<11)
#define SYS_CTRL_AP_ENABLE_APB1D_PWM (1<<12)
#define SYS_CTRL_AP_ENABLE_APB1_ALWAYS (1<<13)
#define SYS_CTRL_AP_ENABLE_APB1_DAPLITE (1<<14)
#define SYS_CTRL_AP_ENABLE_APB1_TIMER (1<<15)
#define SYS_CTRL_AP_ENABLE_APB1_GPIO (1<<16)
#define SYS_CTRL_AP_ENABLE_CLK_APB1(n) (((n)&0x1FFFF)<<0)
#define SYS_CTRL_AP_ENABLE_CLK_APB1_MASK (0x1FFFF<<0)
#define SYS_CTRL_AP_ENABLE_CLK_APB1_SHIFT (0)

//Clk_APB1_Disable
#define SYS_CTRL_AP_DISABLE_APB1_CONF (1<<0)
#define SYS_CTRL_AP_DISABLE_APB1_AIF (1<<1)
#define SYS_CTRL_AP_DISABLE_APB1_AIF2 (1<<2)
#define SYS_CTRL_AP_DISABLE_APB1_AUIFC (1<<3)
#define SYS_CTRL_AP_DISABLE_APB1_AUIFC_CH0 (1<<4)
#define SYS_CTRL_AP_DISABLE_APB1_AUIFC_CH1 (1<<5)
#define SYS_CTRL_AP_DISABLE_APB1_AUIFC_CH2 (1<<6)
#define SYS_CTRL_AP_DISABLE_APB1_AUIFC_CH3 (1<<7)
#define SYS_CTRL_AP_DISABLE_APB1_I2C1 (1<<8)
#define SYS_CTRL_AP_DISABLE_APB1_I2C2 (1<<9)
#define SYS_CTRL_AP_DISABLE_APB1_I2C3 (1<<10)
#define SYS_CTRL_AP_DISABLE_APB1D_OSC (1<<11)
#define SYS_CTRL_AP_DISABLE_APB1D_PWM (1<<12)
#define SYS_CTRL_AP_DISABLE_APB1_ALWAYS (1<<13)
#define SYS_CTRL_AP_DISABLE_APB1_DAPLITE (1<<14)
#define SYS_CTRL_AP_DISABLE_APB1_TIMER (1<<15)
#define SYS_CTRL_AP_DISABLE_APB1_GPIO (1<<16)
#define SYS_CTRL_AP_DISABLE_CLK_APB1(n) (((n)&0x1FFFF)<<0)
#define SYS_CTRL_AP_DISABLE_CLK_APB1_MASK (0x1FFFF<<0)
#define SYS_CTRL_AP_DISABLE_CLK_APB1_SHIFT (0)

//Clk_APB2_Mode
#define SYS_CTRL_AP_MODE_APB2_CONF_AUTOMATIC (0<<0)
#define SYS_CTRL_AP_MODE_APB2_CONF_MANUAL (1<<0)
#define SYS_CTRL_AP_MODE_APB2_IFC_AUTOMATIC (0<<1)
#define SYS_CTRL_AP_MODE_APB2_IFC_MANUAL (1<<1)
#define SYS_CTRL_AP_MODE_APB2_IFC_CH0_AUTOMATIC (0<<2)
#define SYS_CTRL_AP_MODE_APB2_IFC_CH0_MANUAL (1<<2)
#define SYS_CTRL_AP_MODE_APB2_IFC_CH1_AUTOMATIC (0<<3)
#define SYS_CTRL_AP_MODE_APB2_IFC_CH1_MANUAL (1<<3)
#define SYS_CTRL_AP_MODE_APB2_IFC_CH2_AUTOMATIC (0<<4)
#define SYS_CTRL_AP_MODE_APB2_IFC_CH2_MANUAL (1<<4)
#define SYS_CTRL_AP_MODE_APB2_IFC_CH3_AUTOMATIC (0<<5)
#define SYS_CTRL_AP_MODE_APB2_IFC_CH3_MANUAL (1<<5)
#define SYS_CTRL_AP_MODE_APB2_IFC_CH4_AUTOMATIC (0<<6)
#define SYS_CTRL_AP_MODE_APB2_IFC_CH4_MANUAL (1<<6)
#define SYS_CTRL_AP_MODE_APB2_IFC_CH5_AUTOMATIC (0<<7)
#define SYS_CTRL_AP_MODE_APB2_IFC_CH5_MANUAL (1<<7)
#define SYS_CTRL_AP_MODE_APB2_IFC_CH6_AUTOMATIC (0<<8)
#define SYS_CTRL_AP_MODE_APB2_IFC_CH6_MANUAL (1<<8)
#define SYS_CTRL_AP_MODE_APB2_IFC_CH7_AUTOMATIC (0<<9)
#define SYS_CTRL_AP_MODE_APB2_IFC_CH7_MANUAL (1<<9)
#define SYS_CTRL_AP_MODE_APB2_UART1_AUTOMATIC (0<<10)
#define SYS_CTRL_AP_MODE_APB2_UART1_MANUAL (1<<10)
#define SYS_CTRL_AP_MODE_APB2_UART2_AUTOMATIC (0<<11)
#define SYS_CTRL_AP_MODE_APB2_UART2_MANUAL (1<<11)
#define SYS_CTRL_AP_MODE_APB2_UART3_AUTOMATIC (0<<12)
#define SYS_CTRL_AP_MODE_APB2_UART3_MANUAL (1<<12)
#define SYS_CTRL_AP_MODE_APB2_SPI1_AUTOMATIC (0<<13)
#define SYS_CTRL_AP_MODE_APB2_SPI1_MANUAL (1<<13)
#define SYS_CTRL_AP_MODE_APB2_SPI2_AUTOMATIC (0<<14)
#define SYS_CTRL_AP_MODE_APB2_SPI2_MANUAL (1<<14)
#define SYS_CTRL_AP_MODE_APB2_SPI3_AUTOMATIC (0<<15)
#define SYS_CTRL_AP_MODE_APB2_SPI3_MANUAL (1<<15)
#define SYS_CTRL_AP_MODE_APB2_SDMMC1_AUTOMATIC (0<<16)
#define SYS_CTRL_AP_MODE_APB2_SDMMC1_MANUAL (1<<16)
#define SYS_CTRL_AP_MODE_APB2_SDMMC2_AUTOMATIC (0<<17)
#define SYS_CTRL_AP_MODE_APB2_SDMMC2_MANUAL (1<<17)
#define SYS_CTRL_AP_MODE_APB2_SDMMC3_AUTOMATIC (0<<18)
#define SYS_CTRL_AP_MODE_APB2_SDMMC3_MANUAL (1<<18)
#define SYS_CTRL_AP_MODE_CLK_APB2(n) (((n)&0x7FFFF)<<0)
#define SYS_CTRL_AP_MODE_CLK_APB2_MASK (0x7FFFF<<0)
#define SYS_CTRL_AP_MODE_CLK_APB2_SHIFT (0)

//Clk_APB2_Enable
#define SYS_CTRL_AP_ENABLE_APB2_CONF (1<<0)
#define SYS_CTRL_AP_ENABLE_APB2_IFC (1<<1)
#define SYS_CTRL_AP_ENABLE_APB2_IFC_CH0 (1<<2)
#define SYS_CTRL_AP_ENABLE_APB2_IFC_CH1 (1<<3)
#define SYS_CTRL_AP_ENABLE_APB2_IFC_CH2 (1<<4)
#define SYS_CTRL_AP_ENABLE_APB2_IFC_CH3 (1<<5)
#define SYS_CTRL_AP_ENABLE_APB2_IFC_CH4 (1<<6)
#define SYS_CTRL_AP_ENABLE_APB2_IFC_CH5 (1<<7)
#define SYS_CTRL_AP_ENABLE_APB2_IFC_CH6 (1<<8)
#define SYS_CTRL_AP_ENABLE_APB2_IFC_CH7 (1<<9)
#define SYS_CTRL_AP_ENABLE_APB2_UART1 (1<<10)
#define SYS_CTRL_AP_ENABLE_APB2_UART2 (1<<11)
#define SYS_CTRL_AP_ENABLE_APB2_UART3 (1<<12)
#define SYS_CTRL_AP_ENABLE_APB2_SPI1 (1<<13)
#define SYS_CTRL_AP_ENABLE_APB2_SPI2 (1<<14)
#define SYS_CTRL_AP_ENABLE_APB2_SPI3 (1<<15)
#define SYS_CTRL_AP_ENABLE_APB2_SDMMC1 (1<<16)
#define SYS_CTRL_AP_ENABLE_APB2_SDMMC2 (1<<17)
#define SYS_CTRL_AP_ENABLE_APB2_SDMMC3 (1<<18)
#define SYS_CTRL_AP_ENABLE_APB2_ALWAYS (1<<19)
#define SYS_CTRL_AP_ENABLE_APB2_NANDFLASH (1<<20)
#define SYS_CTRL_AP_ENABLE_CLK_APB2(n) (((n)&0x1FFFFF)<<0)
#define SYS_CTRL_AP_ENABLE_CLK_APB2_MASK (0x1FFFFF<<0)
#define SYS_CTRL_AP_ENABLE_CLK_APB2_SHIFT (0)

//Clk_APB2_Disable
#define SYS_CTRL_AP_DISABLE_APB2_CONF (1<<0)
#define SYS_CTRL_AP_DISABLE_APB2_IFC (1<<1)
#define SYS_CTRL_AP_DISABLE_APB2_IFC_CH0 (1<<2)
#define SYS_CTRL_AP_DISABLE_APB2_IFC_CH1 (1<<3)
#define SYS_CTRL_AP_DISABLE_APB2_IFC_CH2 (1<<4)
#define SYS_CTRL_AP_DISABLE_APB2_IFC_CH3 (1<<5)
#define SYS_CTRL_AP_DISABLE_APB2_IFC_CH4 (1<<6)
#define SYS_CTRL_AP_DISABLE_APB2_IFC_CH5 (1<<7)
#define SYS_CTRL_AP_DISABLE_APB2_IFC_CH6 (1<<8)
#define SYS_CTRL_AP_DISABLE_APB2_IFC_CH7 (1<<9)
#define SYS_CTRL_AP_DISABLE_APB2_UART1 (1<<10)
#define SYS_CTRL_AP_DISABLE_APB2_UART2 (1<<11)
#define SYS_CTRL_AP_DISABLE_APB2_UART3 (1<<12)
#define SYS_CTRL_AP_DISABLE_APB2_SPI1 (1<<13)
#define SYS_CTRL_AP_DISABLE_APB2_SPI2 (1<<14)
#define SYS_CTRL_AP_DISABLE_APB2_SPI3 (1<<15)
#define SYS_CTRL_AP_DISABLE_APB2_SDMMC1 (1<<16)
#define SYS_CTRL_AP_DISABLE_APB2_SDMMC2 (1<<17)
#define SYS_CTRL_AP_DISABLE_APB2_SDMMC3 (1<<18)
#define SYS_CTRL_AP_DISABLE_APB2_ALWAYS (1<<19)
#define SYS_CTRL_AP_DISABLE_APB2_NANDFLASH (1<<20)
#define SYS_CTRL_AP_DISABLE_CLK_APB2(n) (((n)&0x1FFFFF)<<0)
#define SYS_CTRL_AP_DISABLE_CLK_APB2_MASK (0x1FFFFF<<0)
#define SYS_CTRL_AP_DISABLE_CLK_APB2_SHIFT (0)

//Clk_MEM_Mode
#define SYS_CTRL_AP_MODE_CLK_MEM_AUTOMATIC (0<<0)
#define SYS_CTRL_AP_MODE_CLK_MEM_MANUAL (1<<0)

//Clk_MEM_Enable
#define SYS_CTRL_AP_ENABLE_MEM_CONF (1<<0)
#define SYS_CTRL_AP_ENABLE_MEM_DMC (1<<1)
#define SYS_CTRL_AP_ENABLE_MEM_GPU (1<<2)
#define SYS_CTRL_AP_ENABLE_MEM_VPU (1<<3)
#define SYS_CTRL_AP_ENABLE_MEM_DDRPHY_P (1<<4)
#define SYS_CTRL_AP_ENABLE_MEM_CONNECT (1<<5)
#define SYS_CTRL_AP_ENABLE_CLK_MEM(n) (((n)&0x3F)<<0)
#define SYS_CTRL_AP_ENABLE_CLK_MEM_MASK (0x3F<<0)
#define SYS_CTRL_AP_ENABLE_CLK_MEM_SHIFT (0)

//Clk_MEM_Disable
#define SYS_CTRL_AP_DISABLE_MEM_CONF (1<<0)
#define SYS_CTRL_AP_DISABLE_MEM_DMC (1<<1)
#define SYS_CTRL_AP_DISABLE_MEM_GPU (1<<2)
#define SYS_CTRL_AP_DISABLE_MEM_VPU (1<<3)
#define SYS_CTRL_AP_DISABLE_MEM_DDRPHY_P (1<<4)
#define SYS_CTRL_AP_DISABLE_MEM_CONNECT (1<<5)
#define SYS_CTRL_AP_DISABLE_CLK_MEM(n) (((n)&0x3F)<<0)
#define SYS_CTRL_AP_DISABLE_CLK_MEM_MASK (0x3F<<0)
#define SYS_CTRL_AP_DISABLE_CLK_MEM_SHIFT (0)

//Clk_APO_Mode
#define SYS_CTRL_AP_MODE_APOC_VPU_AUTOMATIC (0<<0)
#define SYS_CTRL_AP_MODE_APOC_VPU_MANUAL (1<<0)
#define SYS_CTRL_AP_MODE_APOC_BCK_AUTOMATIC (0<<1)
#define SYS_CTRL_AP_MODE_APOC_BCK_MANUAL (1<<1)
#define SYS_CTRL_AP_MODE_APOC_BCK2_AUTOMATIC (0<<2)
#define SYS_CTRL_AP_MODE_APOC_BCK2_MANUAL (1<<2)
#define SYS_CTRL_AP_MODE_APOC_UART1_AUTOMATIC (0<<3)
#define SYS_CTRL_AP_MODE_APOC_UART1_MANUAL (1<<3)
#define SYS_CTRL_AP_MODE_APOC_UART2_AUTOMATIC (0<<4)
#define SYS_CTRL_AP_MODE_APOC_UART2_MANUAL (1<<4)
#define SYS_CTRL_AP_MODE_APOC_UART3_AUTOMATIC (0<<5)
#define SYS_CTRL_AP_MODE_APOC_UART3_MANUAL (1<<5)
#define SYS_CTRL_AP_MODE_APOC_VOC_CORE_AUTOMATIC (0<<6)
#define SYS_CTRL_AP_MODE_APOC_VOC_CORE_MANUAL (1<<6)
#define SYS_CTRL_AP_MODE_APOC_VOC2_CORE_AUTOMATIC (0<<7)
#define SYS_CTRL_AP_MODE_APOC_VOC2_CORE_MANUAL (1<<7)
#define SYS_CTRL_AP_MODE_APOC_VOC_AUTOMATIC (0<<8)
#define SYS_CTRL_AP_MODE_APOC_VOC_MANUAL (1<<8)
#define SYS_CTRL_AP_MODE_APOC_VOC2_AUTOMATIC (0<<9)
#define SYS_CTRL_AP_MODE_APOC_VOC2_MANUAL (1<<9)
#define SYS_CTRL_AP_MODE_CLK_APO(n) (((n)&0x3FF)<<0)
#define SYS_CTRL_AP_MODE_CLK_APO_MASK (0x3FF<<0)
#define SYS_CTRL_AP_MODE_CLK_APO_SHIFT (0)

//Clk_APO_Enable
#define SYS_CTRL_AP_ENABLE_APOC_VPU (1<<0)
#define SYS_CTRL_AP_ENABLE_APOC_BCK (1<<1)
#define SYS_CTRL_AP_ENABLE_APOC_BCK2 (1<<2)
#define SYS_CTRL_AP_ENABLE_APOC_UART1 (1<<3)
#define SYS_CTRL_AP_ENABLE_APOC_UART2 (1<<4)
#define SYS_CTRL_AP_ENABLE_APOC_UART3 (1<<5)
#define SYS_CTRL_AP_ENABLE_APOC_VOC_CORE (1<<6)
#define SYS_CTRL_AP_ENABLE_APOC_VOC2_CORE (1<<7)
#define SYS_CTRL_AP_ENABLE_APOC_VOC (1<<8)
#define SYS_CTRL_AP_ENABLE_APOC_VOC2 (1<<9)
#define SYS_CTRL_AP_ENABLE_APOC_VOC_ALWAYS (1<<10)
#define SYS_CTRL_AP_ENABLE_APOC_VOC2_ALWAYS (1<<11)
#define SYS_CTRL_AP_ENABLE_APOC_DDRPHY_N (1<<12)
#define SYS_CTRL_AP_ENABLE_APOC_DDRPHY2XP (1<<13)
#define SYS_CTRL_AP_ENABLE_APOC_DDRPHY2XN (1<<14)
#define SYS_CTRL_AP_ENABLE_APOC_GPU (1<<15)
#define SYS_CTRL_AP_ENABLE_APOC_USBPHY (1<<16)
#define SYS_CTRL_AP_ENABLE_APOC_CSI (1<<17)
#define SYS_CTRL_AP_ENABLE_APOC_DSI (1<<18)
#define SYS_CTRL_AP_ENABLE_APOC_GPIO (1<<19)
#define SYS_CTRL_AP_ENABLE_APOC_SPIFLASH (1<<20)
#define SYS_CTRL_AP_ENABLE_APOC_PIX (1<<21)
#define SYS_CTRL_AP_ENABLE_APOC_PDGB (1<<22)
#define SYS_CTRL_AP_ENABLE_CLK_APO(n) (((n)&0x7FFFFF)<<0)
#define SYS_CTRL_AP_ENABLE_CLK_APO_MASK (0x7FFFFF<<0)
#define SYS_CTRL_AP_ENABLE_CLK_APO_SHIFT (0)

//Clk_APO_Disable
#define SYS_CTRL_AP_DISABLE_APOC_VPU (1<<0)
#define SYS_CTRL_AP_DISABLE_APOC_BCK (1<<1)
#define SYS_CTRL_AP_DISABLE_APOC_BCK2 (1<<2)
#define SYS_CTRL_AP_DISABLE_APOC_UART1 (1<<3)
#define SYS_CTRL_AP_DISABLE_APOC_UART2 (1<<4)
#define SYS_CTRL_AP_DISABLE_APOC_UART3 (1<<5)
#define SYS_CTRL_AP_DISABLE_APOC_VOC_CORE (1<<6)
#define SYS_CTRL_AP_DISABLE_APOC_VOC2_CORE (1<<7)
#define SYS_CTRL_AP_DISABLE_APOC_VOC (1<<8)
#define SYS_CTRL_AP_DISABLE_APOC_VOC2 (1<<9)
#define SYS_CTRL_AP_DISABLE_APOC_VOC_ALWAYS (1<<10)
#define SYS_CTRL_AP_DISABLE_APOC_VOC2_ALWAYS (1<<11)
#define SYS_CTRL_AP_DISABLE_APOC_DDRPHY_N (1<<12)
#define SYS_CTRL_AP_DISABLE_APOC_DDRPHY2XP (1<<13)
#define SYS_CTRL_AP_DISABLE_APOC_DDRPHY2XN (1<<14)
#define SYS_CTRL_AP_DISABLE_APOC_GPU (1<<15)
#define SYS_CTRL_AP_DISABLE_APOC_USBPHY (1<<16)
#define SYS_CTRL_AP_DISABLE_APOC_CSI (1<<17)
#define SYS_CTRL_AP_DISABLE_APOC_DSI (1<<18)
#define SYS_CTRL_AP_DISABLE_APOC_GPIO (1<<19)
#define SYS_CTRL_AP_DISABLE_APOC_SPIFLASH (1<<20)
#define SYS_CTRL_AP_DISABLE_APOC_PIX (1<<21)
#define SYS_CTRL_AP_DISABLE_APOC_PDGB (1<<22)
#define SYS_CTRL_AP_DISABLE_CLK_APO(n) (((n)&0x7FFFFF)<<0)
#define SYS_CTRL_AP_DISABLE_CLK_APO_MASK (0x7FFFFF<<0)
#define SYS_CTRL_AP_DISABLE_CLK_APO_SHIFT (0)

//Cfg_Clk_AP_CPU
#define SYS_CTRL_AP_AP_CPU_FREQ(n) (((n)&31)<<0)
#define SYS_CTRL_AP_AP_CPU_FREQ_MASK (31<<0)
#define SYS_CTRL_AP_AP_CPU_FREQ_SHIFT (0)
#define SYS_CTRL_AP_AP_CPU_FREQ_19M (6<<0)
#define SYS_CTRL_AP_AP_CPU_FREQ_20M (7<<0)
#define SYS_CTRL_AP_AP_CPU_FREQ_300M (26<<0)
#define SYS_CTRL_AP_AP_CPU_FREQ_340M (27<<0)
#define SYS_CTRL_AP_AP_CPU_FREQ_400M (28<<0)
#define SYS_CTRL_AP_AP_CPU_FREQ_480M (29<<0)
#define SYS_CTRL_AP_AP_CPU_FREQ_600M (30<<0)
#define SYS_CTRL_AP_AP_CPU_FREQ_1_2G (31<<0)
#define SYS_CTRL_AP_BUS_DIV_SEL(n) (((n)&3)<<16)
#define SYS_CTRL_AP_BUS_DIV_SEL_MASK (3<<16)
#define SYS_CTRL_AP_BUS_DIV_SEL_SHIFT (16)
#define SYS_CTRL_AP_BUS_DIV_SEL_DIV2 (0<<16)
#define SYS_CTRL_AP_BUS_DIV_SEL_DIV3 (1<<16)
#define SYS_CTRL_AP_BUS_DIV_SEL_DIV4 (2<<16)
#define SYS_CTRL_AP_AP_CPU_REQ_DIV_UPDATE (1<<31)

//Cfg_Clk_AP_AXI
#define SYS_CTRL_AP_AP_AXI_FREQ(n) (((n)&31)<<0)
#define SYS_CTRL_AP_AP_AXI_FREQ_MASK (31<<0)
#define SYS_CTRL_AP_AP_AXI_FREQ_SHIFT (0)
#define SYS_CTRL_AP_AP_AXI_FREQ_19M (6<<0)
#define SYS_CTRL_AP_AP_AXI_FREQ_20M (7<<0)
#define SYS_CTRL_AP_AP_AXI_FREQ_300M (26<<0)
#define SYS_CTRL_AP_AP_AXI_FREQ_340M (27<<0)
#define SYS_CTRL_AP_AP_AXI_FREQ_400M (28<<0)
#define SYS_CTRL_AP_AP_AXI_FREQ_480M (29<<0)
#define SYS_CTRL_AP_AP_AXI_FREQ_600M (30<<0)
#define SYS_CTRL_AP_AP_AXI_FREQ_1_2G (31<<0)
#define SYS_CTRL_AP_AP_AXI_SRC_SEL (1<<12)
#define SYS_CTRL_AP_AP_AXI_REQ_DIV_UPDATE (1<<31)

//Cfg_Clk_AP_GCG
#define SYS_CTRL_AP_AP_GCG_FREQ(n) (((n)&31)<<0)
#define SYS_CTRL_AP_AP_GCG_FREQ_MASK (31<<0)
#define SYS_CTRL_AP_AP_GCG_FREQ_SHIFT (0)
#define SYS_CTRL_AP_AP_GCG_FREQ_19M (6<<0)
#define SYS_CTRL_AP_AP_GCG_FREQ_20M (7<<0)
#define SYS_CTRL_AP_AP_GCG_FREQ_300M (26<<0)
#define SYS_CTRL_AP_AP_GCG_FREQ_340M (27<<0)
#define SYS_CTRL_AP_AP_GCG_FREQ_400M (28<<0)
#define SYS_CTRL_AP_AP_GCG_FREQ_480M (29<<0)
#define SYS_CTRL_AP_AP_GCG_FREQ_600M (30<<0)
#define SYS_CTRL_AP_AP_GCG_FREQ_1_2G (31<<0)
#define SYS_CTRL_AP_AP_GCG_SRC_SEL (1<<12)
#define SYS_CTRL_AP_AP_GCG_REQ_DIV_UPDATE (1<<31)

//Cfg_Clk_AP_AHB1
#define SYS_CTRL_AP_AP_AHB1_FREQ(n) (((n)&31)<<0)
#define SYS_CTRL_AP_AP_AHB1_FREQ_MASK (31<<0)
#define SYS_CTRL_AP_AP_AHB1_FREQ_SHIFT (0)
#define SYS_CTRL_AP_AP_AHB1_FREQ_19M (6<<0)
#define SYS_CTRL_AP_AP_AHB1_FREQ_20M (7<<0)
#define SYS_CTRL_AP_AP_AHB1_FREQ_300M (26<<0)
#define SYS_CTRL_AP_AP_AHB1_FREQ_340M (27<<0)
#define SYS_CTRL_AP_AP_AHB1_FREQ_400M (28<<0)
#define SYS_CTRL_AP_AP_AHB1_FREQ_480M (29<<0)
#define SYS_CTRL_AP_AP_AHB1_FREQ_600M (30<<0)
#define SYS_CTRL_AP_AP_AHB1_FREQ_1_2G (31<<0)
#define SYS_CTRL_AP_AP_AHB1_SRC_SEL (1<<12)
#define SYS_CTRL_AP_AP_AHB1_REQ_DIV_UPDATE (1<<31)

//Cfg_Clk_AP_APB1
#define SYS_CTRL_AP_AP_APB1_FREQ(n) (((n)&31)<<0)
#define SYS_CTRL_AP_AP_APB1_FREQ_MASK (31<<0)
#define SYS_CTRL_AP_AP_APB1_FREQ_SHIFT (0)
#define SYS_CTRL_AP_AP_APB1_FREQ_19M (6<<0)
#define SYS_CTRL_AP_AP_APB1_FREQ_20M (7<<0)
#define SYS_CTRL_AP_AP_APB1_FREQ_300M (26<<0)
#define SYS_CTRL_AP_AP_APB1_FREQ_340M (27<<0)
#define SYS_CTRL_AP_AP_APB1_FREQ_400M (28<<0)
#define SYS_CTRL_AP_AP_APB1_FREQ_480M (29<<0)
#define SYS_CTRL_AP_AP_APB1_FREQ_600M (30<<0)
#define SYS_CTRL_AP_AP_APB1_FREQ_1_2G (31<<0)
#define SYS_CTRL_AP_AP_APB1_SRC_SEL (1<<12)
#define SYS_CTRL_AP_AP_APB1_REQ_DIV_UPDATE (1<<31)

//Cfg_Clk_AP_APB2
#define SYS_CTRL_AP_AP_APB2_FREQ(n) (((n)&31)<<0)
#define SYS_CTRL_AP_AP_APB2_FREQ_MASK (31<<0)
#define SYS_CTRL_AP_AP_APB2_FREQ_SHIFT (0)
#define SYS_CTRL_AP_AP_APB2_FREQ_19M (6<<0)
#define SYS_CTRL_AP_AP_APB2_FREQ_20M (7<<0)
#define SYS_CTRL_AP_AP_APB2_FREQ_300M (26<<0)
#define SYS_CTRL_AP_AP_APB2_FREQ_340M (27<<0)
#define SYS_CTRL_AP_AP_APB2_FREQ_400M (28<<0)
#define SYS_CTRL_AP_AP_APB2_FREQ_480M (29<<0)
#define SYS_CTRL_AP_AP_APB2_FREQ_600M (30<<0)
#define SYS_CTRL_AP_AP_APB2_FREQ_1_2G (31<<0)
#define SYS_CTRL_AP_AP_APB2_SRC_SEL (1<<12)
#define SYS_CTRL_AP_AP_APB2_REQ_DIV_UPDATE (1<<31)

//Cfg_Clk_AP_MEM
#define SYS_CTRL_AP_AP_MEM_SRC_DIV2 (1<<12)

//Cfg_Clk_AP_GPU
#define SYS_CTRL_AP_AP_GPU_FREQ(n) (((n)&31)<<0)
#define SYS_CTRL_AP_AP_GPU_FREQ_MASK (31<<0)
#define SYS_CTRL_AP_AP_GPU_FREQ_SHIFT (0)
#define SYS_CTRL_AP_AP_GPU_FREQ_19M (6<<0)
#define SYS_CTRL_AP_AP_GPU_FREQ_20M (7<<0)
#define SYS_CTRL_AP_AP_GPU_FREQ_300M (26<<0)
#define SYS_CTRL_AP_AP_GPU_FREQ_340M (27<<0)
#define SYS_CTRL_AP_AP_GPU_FREQ_400M (28<<0)
#define SYS_CTRL_AP_AP_GPU_FREQ_480M (29<<0)
#define SYS_CTRL_AP_AP_GPU_FREQ_600M (30<<0)
#define SYS_CTRL_AP_AP_GPU_FREQ_1_2G (31<<0)
#define SYS_CTRL_AP_AP_GPU_SRC_DIV2 (1<<12)
#define SYS_CTRL_AP_AP_GPU_REQ_DIV_UPDATE (1<<31)

//Cfg_Clk_AP_VPU
#define SYS_CTRL_AP_AP_VPU_FREQ(n) (((n)&31)<<0)
#define SYS_CTRL_AP_AP_VPU_FREQ_MASK (31<<0)
#define SYS_CTRL_AP_AP_VPU_FREQ_SHIFT (0)
#define SYS_CTRL_AP_AP_VPU_FREQ_19M (6<<0)
#define SYS_CTRL_AP_AP_VPU_FREQ_20M (7<<0)
#define SYS_CTRL_AP_AP_VPU_FREQ_300M (26<<0)
#define SYS_CTRL_AP_AP_VPU_FREQ_340M (27<<0)
#define SYS_CTRL_AP_AP_VPU_FREQ_400M (28<<0)
#define SYS_CTRL_AP_AP_VPU_FREQ_480M (29<<0)
#define SYS_CTRL_AP_AP_VPU_FREQ_600M (30<<0)
#define SYS_CTRL_AP_AP_VPU_FREQ_1_2G (31<<0)
#define SYS_CTRL_AP_AP_VPU_SRC_DIV2 (1<<12)
#define SYS_CTRL_AP_AP_VPU_REQ_DIV_UPDATE (1<<31)

//Cfg_Clk_AP_VOC
#define SYS_CTRL_AP_AP_VOC_FREQ(n) (((n)&31)<<0)
#define SYS_CTRL_AP_AP_VOC_FREQ_MASK (31<<0)
#define SYS_CTRL_AP_AP_VOC_FREQ_SHIFT (0)
#define SYS_CTRL_AP_AP_VOC_FREQ_19M (6<<0)
#define SYS_CTRL_AP_AP_VOC_FREQ_20M (7<<0)
#define SYS_CTRL_AP_AP_VOC_FREQ_300M (26<<0)
#define SYS_CTRL_AP_AP_VOC_FREQ_340M (27<<0)
#define SYS_CTRL_AP_AP_VOC_FREQ_400M (28<<0)
#define SYS_CTRL_AP_AP_VOC_FREQ_480M (29<<0)
#define SYS_CTRL_AP_AP_VOC_FREQ_600M (30<<0)
#define SYS_CTRL_AP_AP_VOC_FREQ_1_2G (31<<0)
#define SYS_CTRL_AP_AP_VOC_SRC_DIV2 (1<<12)
#define SYS_CTRL_AP_AP_VOC_REQ_DIV_UPDATE (1<<31)

//Cfg_Clk_AP_SFLSH
#define SYS_CTRL_AP_AP_SFLSH_FREQ(n) (((n)&31)<<0)
#define SYS_CTRL_AP_AP_SFLSH_FREQ_MASK (31<<0)
#define SYS_CTRL_AP_AP_SFLSH_FREQ_SHIFT (0)
#define SYS_CTRL_AP_AP_SFLSH_FREQ_19M (6<<0)
#define SYS_CTRL_AP_AP_SFLSH_FREQ_20M (7<<0)
#define SYS_CTRL_AP_AP_SFLSH_FREQ_300M (26<<0)
#define SYS_CTRL_AP_AP_SFLSH_FREQ_340M (27<<0)
#define SYS_CTRL_AP_AP_SFLSH_FREQ_400M (28<<0)
#define SYS_CTRL_AP_AP_SFLSH_FREQ_480M (29<<0)
#define SYS_CTRL_AP_AP_SFLSH_FREQ_600M (30<<0)
#define SYS_CTRL_AP_AP_SFLSH_FREQ_1_2G (31<<0)
#define SYS_CTRL_AP_AP_SFLSH_SRC_DIV2 (1<<12)
#define SYS_CTRL_AP_AP_SFLSH_REQ_DIV_UPDATE (1<<31)

//Cfg_Clk_Uart
#define SYS_CTRL_AP_UART_DIVIDER(n) (((n)&0x3FF)<<0)
#define SYS_CTRL_AP_UART_DIVIDER_MASK (0x3FF<<0)
#define SYS_CTRL_AP_UART_DIVIDER_SHIFT (0)
#define SYS_CTRL_AP_UART_SEL_PLL_SLOW (0<<12)
#define SYS_CTRL_AP_UART_SEL_PLL_PLL (1<<12)

//L2cc_Ctrl
#define SYS_CTRL_AP_ARQOS_L2CC_1_M(n) (((n)&15)<<0)
#define SYS_CTRL_AP_ARQOS_L2CC_1_M_MASK (15<<0)
#define SYS_CTRL_AP_ARQOS_L2CC_1_M_SHIFT (0)
#define SYS_CTRL_AP_AWQOS_L2CC_1_M(n) (((n)&15)<<4)
#define SYS_CTRL_AP_AWQOS_L2CC_1_M_MASK (15<<4)
#define SYS_CTRL_AP_AWQOS_L2CC_1_M_SHIFT (4)
#define SYS_CTRL_AP_ARQOS_MODEM_MEM_AHBS_M(n) (((n)&15)<<8)
#define SYS_CTRL_AP_ARQOS_MODEM_MEM_AHBS_M_MASK (15<<8)
#define SYS_CTRL_AP_ARQOS_MODEM_MEM_AHBS_M_SHIFT (8)
#define SYS_CTRL_AP_AWQOS_MODEM_MEM_AHBS_M(n) (((n)&15)<<12)
#define SYS_CTRL_AP_AWQOS_MODEM_MEM_AHBS_M_MASK (15<<12)
#define SYS_CTRL_AP_AWQOS_MODEM_MEM_AHBS_M_SHIFT (12)
#define SYS_CTRL_AP_ARAP_L2CC_1_M  (1<<16)
#define SYS_CTRL_AP_AWAP_L2CC_1_M  (1<<17)
#define SYS_CTRL_AP_ARAP_MODEM_MEM_AHBS_M (1<<18)
#define SYS_CTRL_AP_AWAP_MODEM_MEM_AHBS_M (1<<19)
#define SYS_CTRL_AP_ARAP_MERGE1M   (1<<20)
#define SYS_CTRL_AP_AWAP_MERGE1M   (1<<21)
#define SYS_CTRL_AP_ARAP_MERGE2M   (1<<22)
#define SYS_CTRL_AP_AWAP_MERGE2M   (1<<23)
#define SYS_CTRL_AP_RESERVE1(n)    (((n)&0xFF)<<24)
#define SYS_CTRL_AP_RESERVE1_MASK  (0xFF<<24)
#define SYS_CTRL_AP_RESERVE1_SHIFT (24)

//Spi_Ctrl
#define SYS_CTRL_AP_LIMITED_EN_SPI1 (1<<0)
#define SYS_CTRL_AP_LPSEN_SPI1     (1<<1)
#define SYS_CTRL_AP_LIMITED_EN_SPI2 (1<<2)
#define SYS_CTRL_AP_LPSEN_SPI2     (1<<3)
#define SYS_CTRL_AP_LIMITED_EN_SPI3 (1<<4)
#define SYS_CTRL_AP_LPSEN_SPI3     (1<<5)
#define SYS_CTRL_AP_FBUSWID_NFSC   (1<<6)
#define SYS_CTRL_AP_RESERVE3       (1<<7)
#define SYS_CTRL_AP_DMC_CFG(n)     (((n)&0x3FF)<<8)
#define SYS_CTRL_AP_DMC_CFG_MASK   (0x3FF<<8)
#define SYS_CTRL_AP_DMC_CFG_SHIFT  (8)
#define SYS_CTRL_AP_RESERVE2(n)    (((n)&0x3FFF)<<18)
#define SYS_CTRL_AP_RESERVE2_MASK  (0x3FFF<<18)
#define SYS_CTRL_AP_RESERVE2_SHIFT (18)

//Memory_Margin
#define SYS_CTRL_AP_EMAW_VOC(n)    (((n)&3)<<0)
#define SYS_CTRL_AP_EMAW_VOC_MASK  (3<<0)
#define SYS_CTRL_AP_EMAW_VOC_SHIFT (0)
#define SYS_CTRL_AP_EMA_VOC(n)     (((n)&7)<<2)
#define SYS_CTRL_AP_EMA_VOC_MASK   (7<<2)
#define SYS_CTRL_AP_EMA_VOC_SHIFT  (2)
#define SYS_CTRL_AP_EMAW_VPU(n)    (((n)&3)<<5)
#define SYS_CTRL_AP_EMAW_VPU_MASK  (3<<5)
#define SYS_CTRL_AP_EMAW_VPU_SHIFT (5)
#define SYS_CTRL_AP_EMA_VPU(n)     (((n)&7)<<7)
#define SYS_CTRL_AP_EMA_VPU_MASK   (7<<7)
#define SYS_CTRL_AP_EMA_VPU_SHIFT  (7)
#define SYS_CTRL_AP_EMAW_GPU(n)    (((n)&3)<<10)
#define SYS_CTRL_AP_EMAW_GPU_MASK  (3<<10)
#define SYS_CTRL_AP_EMAW_GPU_SHIFT (10)
#define SYS_CTRL_AP_EMA_GPU(n)     (((n)&7)<<12)
#define SYS_CTRL_AP_EMA_GPU_MASK   (7<<12)
#define SYS_CTRL_AP_EMA_GPU_SHIFT  (12)
#define SYS_CTRL_AP_EMAW_GOUDA(n)  (((n)&3)<<15)
#define SYS_CTRL_AP_EMAW_GOUDA_MASK (3<<15)
#define SYS_CTRL_AP_EMAW_GOUDA_SHIFT (15)
#define SYS_CTRL_AP_EMA_GOUDA(n)   (((n)&7)<<17)
#define SYS_CTRL_AP_EMA_GOUDA_MASK (7<<17)
#define SYS_CTRL_AP_EMA_GOUDA_SHIFT (17)
#define SYS_CTRL_AP_EMAW_IMEM(n)   (((n)&3)<<20)
#define SYS_CTRL_AP_EMAW_IMEM_MASK (3<<20)
#define SYS_CTRL_AP_EMAW_IMEM_SHIFT (20)
#define SYS_CTRL_AP_EMA_IMEM(n)    (((n)&7)<<22)
#define SYS_CTRL_AP_EMA_IMEM_MASK  (7<<22)
#define SYS_CTRL_AP_EMA_IMEM_SHIFT (22)
#define SYS_CTRL_AP_EMAW_USB(n)    (((n)&3)<<25)
#define SYS_CTRL_AP_EMAW_USB_MASK  (3<<25)
#define SYS_CTRL_AP_EMAW_USB_SHIFT (25)
#define SYS_CTRL_AP_EMA_USB(n)     (((n)&7)<<27)
#define SYS_CTRL_AP_EMA_USB_MASK   (7<<27)
#define SYS_CTRL_AP_EMA_USB_SHIFT  (27)

//Memory_Margin2
#define SYS_CTRL_AP_EMAW_NFSC(n)   (((n)&3)<<0)
#define SYS_CTRL_AP_EMAW_NFSC_MASK (3<<0)
#define SYS_CTRL_AP_EMAW_NFSC_SHIFT (0)
#define SYS_CTRL_AP_EMA_NFSC(n)    (((n)&7)<<2)
#define SYS_CTRL_AP_EMA_NFSC_MASK  (7<<2)
#define SYS_CTRL_AP_EMA_NFSC_SHIFT (2)
#define SYS_CTRL_AP_EMA_VPUROM(n)  (((n)&7)<<5)
#define SYS_CTRL_AP_EMA_VPUROM_MASK (7<<5)
#define SYS_CTRL_AP_EMA_VPUROM_SHIFT (5)
#define SYS_CTRL_AP_EMA_IMEMROM(n) (((n)&7)<<8)
#define SYS_CTRL_AP_EMA_IMEMROM_MASK (7<<8)
#define SYS_CTRL_AP_EMA_IMEMROM_SHIFT (8)
#define SYS_CTRL_AP_KEN_VPUROM     (1<<11)
#define SYS_CTRL_AP_PGEN_VPUROM    (1<<12)
#define SYS_CTRL_AP_KEN_IMEMROM    (1<<13)
#define SYS_CTRL_AP_PGEN_IMEMROM   (1<<14)

//Memory_Observe
#define SYS_CTRL_AP_MEM_OBSERVE(n) (((n)&0xFFFFFFFF)<<0)

//Cfg_Clk_AP_VOC2
//#define SYS_CTRL_AP_AP_VOC_FREQ(n) (((n)&31)<<0)
//#define SYS_CTRL_AP_AP_VOC_FREQ_MASK (31<<0)
//#define SYS_CTRL_AP_AP_VOC_FREQ_SHIFT (0)
//#define SYS_CTRL_AP_AP_VOC_FREQ_19M (6<<0)
//#define SYS_CTRL_AP_AP_VOC_FREQ_20M (7<<0)
//#define SYS_CTRL_AP_AP_VOC_FREQ_300M (26<<0)
//#define SYS_CTRL_AP_AP_VOC_FREQ_340M (27<<0)
//#define SYS_CTRL_AP_AP_VOC_FREQ_400M (28<<0)
//#define SYS_CTRL_AP_AP_VOC_FREQ_480M (29<<0)
//#define SYS_CTRL_AP_AP_VOC_FREQ_600M (30<<0)
//#define SYS_CTRL_AP_AP_VOC_FREQ_1_2G (31<<0)
//#define SYS_CTRL_AP_AP_VOC_SRC_DIV2 (1<<12)
//#define SYS_CTRL_AP_AP_VOC_REQ_DIV_UPDATE (1<<31)

//Cfg_Reserve
#define SYS_CTRL_AP_RESERVE(n)     (((n)&0x3FFFFFFF)<<0)
#define SYS_CTRL_AP_AUIFC_CH0_IRQ_MASK (1<<30)
#define SYS_CTRL_AP_AUIFC_CH1_IRQ_MASK (1<<31)





#endif