forked from DevriesL/Exynos8890_ImageBreaker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaic94xx_reg_def.h
2399 lines (1876 loc) · 72.4 KB
/
aic94xx_reg_def.h
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
/*
* Aic94xx SAS/SATA driver hardware registers definitions.
*
* Copyright (C) 2004 Adaptec, Inc. All rights reserved.
* Copyright (C) 2004 David Chaw <[email protected]>
* Copyright (C) 2005 Luben Tuikov <[email protected]>
*
* Luben Tuikov: Some register value updates to make it work with the window
* agnostic register r/w functions. Some register corrections, sizes,
* etc.
*
* This file is licensed under GPLv2.
*
* This file is part of the aic94xx driver.
*
* The aic94xx driver is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; version 2 of the
* License.
*
* The aic94xx driver is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the aic94xx driver; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* $Id: //depot/aic94xx/aic94xx_reg_def.h#27 $
*
*/
#ifndef _ADP94XX_REG_DEF_H_
#define _ADP94XX_REG_DEF_H_
/*
* Common definitions.
*/
#define CSEQ_MODE_PAGE_SIZE 0x200 /* CSEQ mode page size */
#define LmSEQ_MODE_PAGE_SIZE 0x200 /* LmSEQ mode page size */
#define LmSEQ_HOST_REG_SIZE 0x4000 /* LmSEQ Host Register size */
/********************* COM_SAS registers definition *************************/
/* The base is REG_BASE_ADDR, defined in aic94xx_reg.h.
*/
/*
* CHIM Registers, Address Range : (0x00-0xFF)
*/
#define COMBIST (REG_BASE_ADDR + 0x00)
/* bits 31:24 */
#define L7BLKRST 0x80000000
#define L6BLKRST 0x40000000
#define L5BLKRST 0x20000000
#define L4BLKRST 0x10000000
#define L3BLKRST 0x08000000
#define L2BLKRST 0x04000000
#define L1BLKRST 0x02000000
#define L0BLKRST 0x01000000
#define LmBLKRST 0xFF000000
#define LmBLKRST_COMBIST(phyid) (1 << (24 + phyid))
#define OCMBLKRST 0x00400000
#define CTXMEMBLKRST 0x00200000
#define CSEQBLKRST 0x00100000
#define EXSIBLKRST 0x00040000
#define DPIBLKRST 0x00020000
#define DFIFBLKRST 0x00010000
#define HARDRST 0x00000200
#define COMBLKRST 0x00000100
#define FRCDFPERR 0x00000080
#define FRCCIOPERR 0x00000020
#define FRCBISTERR 0x00000010
#define COMBISTEN 0x00000004
#define COMBISTDONE 0x00000002 /* ro */
#define COMBISTFAIL 0x00000001 /* ro */
#define COMSTAT (REG_BASE_ADDR + 0x04)
#define REQMBXREAD 0x00000040
#define RSPMBXAVAIL 0x00000020
#define CSBUFPERR 0x00000008
#define OVLYERR 0x00000004
#define CSERR 0x00000002
#define OVLYDMADONE 0x00000001
#define COMSTAT_MASK (REQMBXREAD | RSPMBXAVAIL | \
CSBUFPERR | OVLYERR | CSERR |\
OVLYDMADONE)
#define COMSTATEN (REG_BASE_ADDR + 0x08)
#define EN_REQMBXREAD 0x00000040
#define EN_RSPMBXAVAIL 0x00000020
#define EN_CSBUFPERR 0x00000008
#define EN_OVLYERR 0x00000004
#define EN_CSERR 0x00000002
#define EN_OVLYDONE 0x00000001
#define SCBPRO (REG_BASE_ADDR + 0x0C)
#define SCBCONS_MASK 0xFFFF0000
#define SCBPRO_MASK 0x0000FFFF
#define CHIMREQMBX (REG_BASE_ADDR + 0x10)
#define CHIMRSPMBX (REG_BASE_ADDR + 0x14)
#define CHIMINT (REG_BASE_ADDR + 0x18)
#define EXT_INT0 0x00000800
#define EXT_INT1 0x00000400
#define PORRSTDET 0x00000200
#define HARDRSTDET 0x00000100
#define DLAVAILQ 0x00000080 /* ro */
#define HOSTERR 0x00000040
#define INITERR 0x00000020
#define DEVINT 0x00000010
#define COMINT 0x00000008
#define DEVTIMER2 0x00000004
#define DEVTIMER1 0x00000002
#define DLAVAIL 0x00000001
#define CHIMINT_MASK (HOSTERR | INITERR | DEVINT | COMINT |\
DEVTIMER2 | DEVTIMER1 | DLAVAIL)
#define DEVEXCEPT_MASK (HOSTERR | INITERR | DEVINT | COMINT)
#define CHIMINTEN (REG_BASE_ADDR + 0x1C)
#define RST_EN_EXT_INT1 0x01000000
#define RST_EN_EXT_INT0 0x00800000
#define RST_EN_HOSTERR 0x00400000
#define RST_EN_INITERR 0x00200000
#define RST_EN_DEVINT 0x00100000
#define RST_EN_COMINT 0x00080000
#define RST_EN_DEVTIMER2 0x00040000
#define RST_EN_DEVTIMER1 0x00020000
#define RST_EN_DLAVAIL 0x00010000
#define SET_EN_EXT_INT1 0x00000100
#define SET_EN_EXT_INT0 0x00000080
#define SET_EN_HOSTERR 0x00000040
#define SET_EN_INITERR 0x00000020
#define SET_EN_DEVINT 0x00000010
#define SET_EN_COMINT 0x00000008
#define SET_EN_DEVTIMER2 0x00000004
#define SET_EN_DEVTIMER1 0x00000002
#define SET_EN_DLAVAIL 0x00000001
#define RST_CHIMINTEN (RST_EN_HOSTERR | RST_EN_INITERR | \
RST_EN_DEVINT | RST_EN_COMINT | \
RST_EN_DEVTIMER2 | RST_EN_DEVTIMER1 |\
RST_EN_DLAVAIL)
#define SET_CHIMINTEN (SET_EN_HOSTERR | SET_EN_INITERR |\
SET_EN_DEVINT | SET_EN_COMINT |\
SET_EN_DLAVAIL)
#define OVLYDMACTL (REG_BASE_ADDR + 0x20)
#define OVLYADR_MASK 0x07FF0000
#define OVLYLSEQ_MASK 0x0000FF00
#define OVLYCSEQ 0x00000080
#define OVLYHALTERR 0x00000040
#define PIOCMODE 0x00000020
#define RESETOVLYDMA 0x00000008 /* wo */
#define STARTOVLYDMA 0x00000004
#define STOPOVLYDMA 0x00000002 /* wo */
#define OVLYDMAACT 0x00000001 /* ro */
#define OVLYDMACNT (REG_BASE_ADDR + 0x24)
#define OVLYDOMAIN1 0x20000000 /* ro */
#define OVLYDOMAIN0 0x10000000
#define OVLYBUFADR_MASK 0x007F0000
#define OVLYDMACNT_MASK 0x00003FFF
#define OVLYDMAADR (REG_BASE_ADDR + 0x28)
#define DMAERR (REG_BASE_ADDR + 0x30)
#define OVLYERRSTAT_MASK 0x0000FF00 /* ro */
#define CSERRSTAT_MASK 0x000000FF /* ro */
#define SPIODATA (REG_BASE_ADDR + 0x34)
/* 0x38 - 0x3C are reserved */
#define T1CNTRLR (REG_BASE_ADDR + 0x40)
#define T1DONE 0x00010000 /* ro */
#define TIMER64 0x00000400
#define T1ENABLE 0x00000200
#define T1RELOAD 0x00000100
#define T1PRESCALER_MASK 0x00000003
#define T1CMPR (REG_BASE_ADDR + 0x44)
#define T1CNTR (REG_BASE_ADDR + 0x48)
#define T2CNTRLR (REG_BASE_ADDR + 0x4C)
#define T2DONE 0x00010000 /* ro */
#define T2ENABLE 0x00000200
#define T2RELOAD 0x00000100
#define T2PRESCALER_MASK 0x00000003
#define T2CMPR (REG_BASE_ADDR + 0x50)
#define T2CNTR (REG_BASE_ADDR + 0x54)
/* 0x58h - 0xFCh are reserved */
/*
* DCH_SAS Registers, Address Range : (0x800-0xFFF)
*/
#define CMDCTXBASE (REG_BASE_ADDR + 0x800)
#define DEVCTXBASE (REG_BASE_ADDR + 0x808)
#define CTXDOMAIN (REG_BASE_ADDR + 0x810)
#define DEVCTXDOMAIN1 0x00000008 /* ro */
#define DEVCTXDOMAIN0 0x00000004
#define CMDCTXDOMAIN1 0x00000002 /* ro */
#define CMDCTXDOMAIN0 0x00000001
#define DCHCTL (REG_BASE_ADDR + 0x814)
#define OCMBISTREPAIR 0x00080000
#define OCMBISTEN 0x00040000
#define OCMBISTDN 0x00020000 /* ro */
#define OCMBISTFAIL 0x00010000 /* ro */
#define DDBBISTEN 0x00004000
#define DDBBISTDN 0x00002000 /* ro */
#define DDBBISTFAIL 0x00001000 /* ro */
#define SCBBISTEN 0x00000400
#define SCBBISTDN 0x00000200 /* ro */
#define SCBBISTFAIL 0x00000100 /* ro */
#define MEMSEL_MASK 0x000000E0
#define MEMSEL_CCM_LSEQ 0x00000000
#define MEMSEL_CCM_IOP 0x00000020
#define MEMSEL_CCM_SASCTL 0x00000040
#define MEMSEL_DCM_LSEQ 0x00000060
#define MEMSEL_DCM_IOP 0x00000080
#define MEMSEL_OCM 0x000000A0
#define FRCERR 0x00000010
#define AUTORLS 0x00000001
#define DCHREVISION (REG_BASE_ADDR + 0x818)
#define DCHREVISION_MASK 0x000000FF
#define DCHSTATUS (REG_BASE_ADDR + 0x81C)
#define EN_CFIFTOERR 0x00020000
#define CFIFTOERR 0x00000200
#define CSEQINT 0x00000100 /* ro */
#define LSEQ7INT 0x00000080 /* ro */
#define LSEQ6INT 0x00000040 /* ro */
#define LSEQ5INT 0x00000020 /* ro */
#define LSEQ4INT 0x00000010 /* ro */
#define LSEQ3INT 0x00000008 /* ro */
#define LSEQ2INT 0x00000004 /* ro */
#define LSEQ1INT 0x00000002 /* ro */
#define LSEQ0INT 0x00000001 /* ro */
#define LSEQINT_MASK (LSEQ7INT | LSEQ6INT | LSEQ5INT |\
LSEQ4INT | LSEQ3INT | LSEQ2INT |\
LSEQ1INT | LSEQ0INT)
#define DCHDFIFDEBUG (REG_BASE_ADDR + 0x820)
#define ENFAIRMST 0x00FF0000
#define DISWRMST9 0x00000200
#define DISWRMST8 0x00000100
#define DISRDMST 0x000000FF
#define ATOMICSTATCTL (REG_BASE_ADDR + 0x824)
/* 8 bit wide */
#define AUTOINC 0x80
#define ATOMICERR 0x04
#define ATOMICWIN 0x02
#define ATOMICDONE 0x01
#define ALTCIOADR (REG_BASE_ADDR + 0x828)
/* 16 bit; bits 8:0 define CIO addr space of CSEQ */
#define ASCBPTR (REG_BASE_ADDR + 0x82C)
/* 16 bit wide */
#define ADDBPTR (REG_BASE_ADDR + 0x82E)
/* 16 bit wide */
#define ANEWDATA (REG_BASE_ADDR + 0x830)
/* 16 bit */
#define AOLDDATA (REG_BASE_ADDR + 0x834)
/* 16 bit */
#define CTXACCESS (REG_BASE_ADDR + 0x838)
/* 32 bit */
/* 0x83Ch - 0xFFCh are reserved */
/*
* ARP2 External Processor Registers, Address Range : (0x00-0x1F)
*/
#define ARP2CTL 0x00
#define FRCSCRPERR 0x00040000
#define FRCARP2PERR 0x00020000
#define FRCARP2ILLOPC 0x00010000
#define ENWAITTO 0x00008000
#define PERRORDIS 0x00004000
#define FAILDIS 0x00002000
#define CIOPERRDIS 0x00001000
#define BREAKEN3 0x00000800
#define BREAKEN2 0x00000400
#define BREAKEN1 0x00000200
#define BREAKEN0 0x00000100
#define EPAUSE 0x00000008
#define PAUSED 0x00000004 /* ro */
#define STEP 0x00000002
#define ARP2RESET 0x00000001 /* wo */
#define ARP2INT 0x04
#define HALTCODE_MASK 0x00FF0000 /* ro */
#define ARP2WAITTO 0x00000100
#define ARP2HALTC 0x00000080
#define ARP2ILLOPC 0x00000040
#define ARP2PERR 0x00000020
#define ARP2CIOPERR 0x00000010
#define ARP2BREAK3 0x00000008
#define ARP2BREAK2 0x00000004
#define ARP2BREAK1 0x00000002
#define ARP2BREAK0 0x00000001
#define ARP2INTEN 0x08
#define EN_ARP2WAITTO 0x00000100
#define EN_ARP2HALTC 0x00000080
#define EN_ARP2ILLOPC 0x00000040
#define EN_ARP2PERR 0x00000020
#define EN_ARP2CIOPERR 0x00000010
#define EN_ARP2BREAK3 0x00000008
#define EN_ARP2BREAK2 0x00000004
#define EN_ARP2BREAK1 0x00000002
#define EN_ARP2BREAK0 0x00000001
#define ARP2BREAKADR01 0x0C
#define BREAKADR1_MASK 0x0FFF0000
#define BREAKADR0_MASK 0x00000FFF
#define ARP2BREAKADR23 0x10
#define BREAKADR3_MASK 0x0FFF0000
#define BREAKADR2_MASK 0x00000FFF
/* 0x14h - 0x1Ch are reserved */
/*
* ARP2 Registers, Address Range : (0x00-0x1F)
* The definitions have the same address offset for CSEQ and LmSEQ
* CIO Bus Registers.
*/
#define MODEPTR 0x00
#define DSTMODE 0xF0
#define SRCMODE 0x0F
#define ALTMODE 0x01
#define ALTDMODE 0xF0
#define ALTSMODE 0x0F
#define ATOMICXCHG 0x02
#define FLAG 0x04
#define INTCODE_MASK 0xF0
#define ALTMODEV2 0x04
#define CARRY_INT 0x02
#define CARRY 0x01
#define ARP2INTCTL 0x05
#define PAUSEDIS 0x80
#define RSTINTCTL 0x40
#define POPALTMODE 0x08
#define ALTMODEV 0x04
#define INTMASK 0x02
#define IRET 0x01
#define STACK 0x06
#define FUNCTION1 0x07
#define PRGMCNT 0x08
#define ACCUM 0x0A
#define SINDEX 0x0C
#define DINDEX 0x0E
#define ALLONES 0x10
#define ALLZEROS 0x11
#define SINDIR 0x12
#define DINDIR 0x13
#define JUMLDIR 0x14
#define ARP2HALTCODE 0x15
#define CURRADDR 0x16
#define LASTADDR 0x18
#define NXTLADDR 0x1A
#define DBGPORTPTR 0x1C
#define DBGPORT 0x1D
/*
* CIO Registers.
* The definitions have the same address offset for CSEQ and LmSEQ
* CIO Bus Registers.
*/
#define MnSCBPTR 0x20
#define MnDDBPTR 0x22
#define SCRATCHPAGE 0x24
#define MnSCRATCHPAGE 0x25
#define SCRATCHPAGESV 0x26
#define MnSCRATCHPAGESV 0x27
#define MnDMAERRS 0x46
#define MnSGDMAERRS 0x47
#define MnSGBUF 0x53
#define MnSGDMASTAT 0x5b
#define MnDDMACTL 0x5c /* RAZOR.rspec.fm rev 1.5 is wrong */
#define MnDDMASTAT 0x5d /* RAZOR.rspec.fm rev 1.5 is wrong */
#define MnDDMAMODE 0x5e /* RAZOR.rspec.fm rev 1.5 is wrong */
#define MnDMAENG 0x60
#define MnPIPECTL 0x61
#define MnSGBADR 0x65
#define MnSCB_SITE 0x100
#define MnDDB_SITE 0x180
/*
* The common definitions below have the same address offset for both
* CSEQ and LmSEQ.
*/
#define BISTCTL0 0x4C
#define BISTCTL1 0x50
#define MAPPEDSCR 0x800
/*
* CSEQ Host Register, Address Range : (0x000-0xFFC)
*/
#define CSEQ_HOST_REG_BASE_ADR 0xB8001000
#define CARP2CTL (CSEQ_HOST_REG_BASE_ADR + ARP2CTL)
#define CARP2INT (CSEQ_HOST_REG_BASE_ADR + ARP2INT)
#define CARP2INTEN (CSEQ_HOST_REG_BASE_ADR + ARP2INTEN)
#define CARP2BREAKADR01 (CSEQ_HOST_REG_BASE_ADR+ARP2BREAKADR01)
#define CARP2BREAKADR23 (CSEQ_HOST_REG_BASE_ADR+ARP2BREAKADR23)
#define CBISTCTL (CSEQ_HOST_REG_BASE_ADR + BISTCTL1)
#define CSEQRAMBISTEN 0x00000040
#define CSEQRAMBISTDN 0x00000020 /* ro */
#define CSEQRAMBISTFAIL 0x00000010 /* ro */
#define CSEQSCRBISTEN 0x00000004
#define CSEQSCRBISTDN 0x00000002 /* ro */
#define CSEQSCRBISTFAIL 0x00000001 /* ro */
#define CMAPPEDSCR (CSEQ_HOST_REG_BASE_ADR + MAPPEDSCR)
/*
* CSEQ CIO Bus Registers, Address Range : (0x0000-0x1FFC)
* 16 modes, each mode is 512 bytes.
* Unless specified, the register should valid for all modes.
*/
#define CSEQ_CIO_REG_BASE_ADR REG_BASE_ADDR_CSEQCIO
#define CSEQm_CIO_REG(Mode, Reg) \
(CSEQ_CIO_REG_BASE_ADR + \
((u32) (Mode) * CSEQ_MODE_PAGE_SIZE) + (u32) (Reg))
#define CMODEPTR (CSEQ_CIO_REG_BASE_ADR + MODEPTR)
#define CALTMODE (CSEQ_CIO_REG_BASE_ADR + ALTMODE)
#define CATOMICXCHG (CSEQ_CIO_REG_BASE_ADR + ATOMICXCHG)
#define CFLAG (CSEQ_CIO_REG_BASE_ADR + FLAG)
#define CARP2INTCTL (CSEQ_CIO_REG_BASE_ADR + ARP2INTCTL)
#define CSTACK (CSEQ_CIO_REG_BASE_ADR + STACK)
#define CFUNCTION1 (CSEQ_CIO_REG_BASE_ADR + FUNCTION1)
#define CPRGMCNT (CSEQ_CIO_REG_BASE_ADR + PRGMCNT)
#define CACCUM (CSEQ_CIO_REG_BASE_ADR + ACCUM)
#define CSINDEX (CSEQ_CIO_REG_BASE_ADR + SINDEX)
#define CDINDEX (CSEQ_CIO_REG_BASE_ADR + DINDEX)
#define CALLONES (CSEQ_CIO_REG_BASE_ADR + ALLONES)
#define CALLZEROS (CSEQ_CIO_REG_BASE_ADR + ALLZEROS)
#define CSINDIR (CSEQ_CIO_REG_BASE_ADR + SINDIR)
#define CDINDIR (CSEQ_CIO_REG_BASE_ADR + DINDIR)
#define CJUMLDIR (CSEQ_CIO_REG_BASE_ADR + JUMLDIR)
#define CARP2HALTCODE (CSEQ_CIO_REG_BASE_ADR + ARP2HALTCODE)
#define CCURRADDR (CSEQ_CIO_REG_BASE_ADR + CURRADDR)
#define CLASTADDR (CSEQ_CIO_REG_BASE_ADR + LASTADDR)
#define CNXTLADDR (CSEQ_CIO_REG_BASE_ADR + NXTLADDR)
#define CDBGPORTPTR (CSEQ_CIO_REG_BASE_ADR + DBGPORTPTR)
#define CDBGPORT (CSEQ_CIO_REG_BASE_ADR + DBGPORT)
#define CSCRATCHPAGE (CSEQ_CIO_REG_BASE_ADR + SCRATCHPAGE)
#define CMnSCBPTR(Mode) CSEQm_CIO_REG(Mode, MnSCBPTR)
#define CMnDDBPTR(Mode) CSEQm_CIO_REG(Mode, MnDDBPTR)
#define CMnSCRATCHPAGE(Mode) CSEQm_CIO_REG(Mode, MnSCRATCHPAGE)
#define CLINKCON (CSEQ_CIO_REG_BASE_ADR + 0x28)
#define CCIOAACESS (CSEQ_CIO_REG_BASE_ADR + 0x2C)
/* mode 0-7 */
#define MnREQMBX 0x30
#define CMnREQMBX(Mode) CSEQm_CIO_REG(Mode, 0x30)
/* mode 8 */
#define CSEQCON CSEQm_CIO_REG(8, 0x30)
/* mode 0-7 */
#define MnRSPMBX 0x34
#define CMnRSPMBX(Mode) CSEQm_CIO_REG(Mode, 0x34)
/* mode 8 */
#define CSEQCOMCTL CSEQm_CIO_REG(8, 0x34)
/* mode 8 */
#define CSEQCOMSTAT CSEQm_CIO_REG(8, 0x35)
/* mode 8 */
#define CSEQCOMINTEN CSEQm_CIO_REG(8, 0x36)
/* mode 8 */
#define CSEQCOMDMACTL CSEQm_CIO_REG(8, 0x37)
#define CSHALTERR 0x10
#define RESETCSDMA 0x08 /* wo */
#define STARTCSDMA 0x04
#define STOPCSDMA 0x02 /* wo */
#define CSDMAACT 0x01 /* ro */
/* mode 0-7 */
#define MnINT 0x38
#define CMnINT(Mode) CSEQm_CIO_REG(Mode, 0x38)
#define CMnREQMBXE 0x02
#define CMnRSPMBXF 0x01
#define CMnINT_MASK 0x00000003
/* mode 8 */
#define CSEQREQMBX CSEQm_CIO_REG(8, 0x38)
/* mode 0-7 */
#define MnINTEN 0x3C
#define CMnINTEN(Mode) CSEQm_CIO_REG(Mode, 0x3C)
#define EN_CMnRSPMBXF 0x01
/* mode 8 */
#define CSEQRSPMBX CSEQm_CIO_REG(8, 0x3C)
/* mode 8 */
#define CSDMAADR CSEQm_CIO_REG(8, 0x40)
/* mode 8 */
#define CSDMACNT CSEQm_CIO_REG(8, 0x48)
/* mode 8 */
#define CSEQDLCTL CSEQm_CIO_REG(8, 0x4D)
#define DONELISTEND 0x10
#define DONELISTSIZE_MASK 0x0F
#define DONELISTSIZE_8ELEM 0x01
#define DONELISTSIZE_16ELEM 0x02
#define DONELISTSIZE_32ELEM 0x03
#define DONELISTSIZE_64ELEM 0x04
#define DONELISTSIZE_128ELEM 0x05
#define DONELISTSIZE_256ELEM 0x06
#define DONELISTSIZE_512ELEM 0x07
#define DONELISTSIZE_1024ELEM 0x08
#define DONELISTSIZE_2048ELEM 0x09
#define DONELISTSIZE_4096ELEM 0x0A
#define DONELISTSIZE_8192ELEM 0x0B
#define DONELISTSIZE_16384ELEM 0x0C
/* mode 8 */
#define CSEQDLOFFS CSEQm_CIO_REG(8, 0x4E)
/* mode 11 */
#define CM11INTVEC0 CSEQm_CIO_REG(11, 0x50)
/* mode 11 */
#define CM11INTVEC1 CSEQm_CIO_REG(11, 0x52)
/* mode 11 */
#define CM11INTVEC2 CSEQm_CIO_REG(11, 0x54)
#define CCONMSK (CSEQ_CIO_REG_BASE_ADR + 0x60)
#define CCONEXIST (CSEQ_CIO_REG_BASE_ADR + 0x61)
#define CCONMODE (CSEQ_CIO_REG_BASE_ADR + 0x62)
#define CTIMERCALC (CSEQ_CIO_REG_BASE_ADR + 0x64)
#define CINTDIS (CSEQ_CIO_REG_BASE_ADR + 0x68)
/* mode 8, 32x32 bits, 128 bytes of mapped buffer */
#define CSBUFFER CSEQm_CIO_REG(8, 0x80)
#define CSCRATCH (CSEQ_CIO_REG_BASE_ADR + 0x1C0)
/* mode 0-8 */
#define CMnSCRATCH(Mode) CSEQm_CIO_REG(Mode, 0x1E0)
/*
* CSEQ Mapped Instruction RAM Page, Address Range : (0x0000-0x1FFC)
*/
#define CSEQ_RAM_REG_BASE_ADR 0xB8004000
/*
* The common definitions below have the same address offset for all the Link
* sequencers.
*/
#define MODECTL 0x40
#define DBGMODE 0x44
#define CONTROL 0x48
#define LEDTIMER 0x00010000
#define LEDTIMERS_10us 0x00000000
#define LEDTIMERS_1ms 0x00000800
#define LEDTIMERS_100ms 0x00001000
#define LEDMODE_TXRX 0x00000000
#define LEDMODE_CONNECTED 0x00000200
#define LEDPOL 0x00000100
#define LSEQRAM 0x1000
/*
* LmSEQ Host Registers, Address Range : (0x0000-0x3FFC)
*/
#define LSEQ0_HOST_REG_BASE_ADR 0xB8020000
#define LSEQ1_HOST_REG_BASE_ADR 0xB8024000
#define LSEQ2_HOST_REG_BASE_ADR 0xB8028000
#define LSEQ3_HOST_REG_BASE_ADR 0xB802C000
#define LSEQ4_HOST_REG_BASE_ADR 0xB8030000
#define LSEQ5_HOST_REG_BASE_ADR 0xB8034000
#define LSEQ6_HOST_REG_BASE_ADR 0xB8038000
#define LSEQ7_HOST_REG_BASE_ADR 0xB803C000
#define LmARP2CTL(LinkNum) (LSEQ0_HOST_REG_BASE_ADR + \
((LinkNum)*LmSEQ_HOST_REG_SIZE) + \
ARP2CTL)
#define LmARP2INT(LinkNum) (LSEQ0_HOST_REG_BASE_ADR + \
((LinkNum)*LmSEQ_HOST_REG_SIZE) + \
ARP2INT)
#define LmARP2INTEN(LinkNum) (LSEQ0_HOST_REG_BASE_ADR + \
((LinkNum)*LmSEQ_HOST_REG_SIZE) + \
ARP2INTEN)
#define LmDBGMODE(LinkNum) (LSEQ0_HOST_REG_BASE_ADR + \
((LinkNum)*LmSEQ_HOST_REG_SIZE) + \
DBGMODE)
#define LmCONTROL(LinkNum) (LSEQ0_HOST_REG_BASE_ADR + \
((LinkNum)*LmSEQ_HOST_REG_SIZE) + \
CONTROL)
#define LmARP2BREAKADR01(LinkNum) (LSEQ0_HOST_REG_BASE_ADR + \
((LinkNum)*LmSEQ_HOST_REG_SIZE) + \
ARP2BREAKADR01)
#define LmARP2BREAKADR23(LinkNum) (LSEQ0_HOST_REG_BASE_ADR + \
((LinkNum)*LmSEQ_HOST_REG_SIZE) + \
ARP2BREAKADR23)
#define LmMODECTL(LinkNum) (LSEQ0_HOST_REG_BASE_ADR + \
((LinkNum)*LmSEQ_HOST_REG_SIZE) + \
MODECTL)
#define LmAUTODISCI 0x08000000
#define LmDSBLBITLT 0x04000000
#define LmDSBLANTT 0x02000000
#define LmDSBLCRTT 0x01000000
#define LmDSBLCONT 0x00000100
#define LmPRIMODE 0x00000080
#define LmDSBLHOLD 0x00000040
#define LmDISACK 0x00000020
#define LmBLIND48 0x00000010
#define LmRCVMODE_MASK 0x0000000C
#define LmRCVMODE_PLD 0x00000000
#define LmRCVMODE_HPC 0x00000004
#define LmDBGMODE(LinkNum) (LSEQ0_HOST_REG_BASE_ADR + \
((LinkNum)*LmSEQ_HOST_REG_SIZE) + \
DBGMODE)
#define LmFRCPERR 0x80000000
#define LmMEMSEL_MASK 0x30000000
#define LmFRCRBPERR 0x00000000
#define LmFRCTBPERR 0x10000000
#define LmFRCSGBPERR 0x20000000
#define LmFRCARBPERR 0x30000000
#define LmRCVIDW 0x00080000
#define LmINVDWERR 0x00040000
#define LmRCVDISP 0x00004000
#define LmDISPERR 0x00002000
#define LmDSBLDSCR 0x00000800
#define LmDSBLSCR 0x00000400
#define LmFRCNAK 0x00000200
#define LmFRCROFS 0x00000100
#define LmFRCCRC 0x00000080
#define LmFRMTYPE_MASK 0x00000070
#define LmSG_DATA 0x00000000
#define LmSG_COMMAND 0x00000010
#define LmSG_TASK 0x00000020
#define LmSG_TGTXFER 0x00000030
#define LmSG_RESPONSE 0x00000040
#define LmSG_IDENADDR 0x00000050
#define LmSG_OPENADDR 0x00000060
#define LmDISCRCGEN 0x00000008
#define LmDISCRCCHK 0x00000004
#define LmSSXMTFRM 0x00000002
#define LmSSRCVFRM 0x00000001
#define LmCONTROL(LinkNum) (LSEQ0_HOST_REG_BASE_ADR + \
((LinkNum)*LmSEQ_HOST_REG_SIZE) + \
CONTROL)
#define LmSTEPXMTFRM 0x00000002
#define LmSTEPRCVFRM 0x00000001
#define LmBISTCTL0(LinkNum) (LSEQ0_HOST_REG_BASE_ADR + \
((LinkNum)*LmSEQ_HOST_REG_SIZE) + \
BISTCTL0)
#define ARBBISTEN 0x40000000
#define ARBBISTDN 0x20000000 /* ro */
#define ARBBISTFAIL 0x10000000 /* ro */
#define TBBISTEN 0x00000400
#define TBBISTDN 0x00000200 /* ro */
#define TBBISTFAIL 0x00000100 /* ro */
#define RBBISTEN 0x00000040
#define RBBISTDN 0x00000020 /* ro */
#define RBBISTFAIL 0x00000010 /* ro */
#define SGBISTEN 0x00000004
#define SGBISTDN 0x00000002 /* ro */
#define SGBISTFAIL 0x00000001 /* ro */
#define LmBISTCTL1(LinkNum) (LSEQ0_HOST_REG_BASE_ADR + \
((LinkNum)*LmSEQ_HOST_REG_SIZE) +\
BISTCTL1)
#define LmRAMPAGE1 0x00000200
#define LmRAMPAGE0 0x00000100
#define LmIMEMBISTEN 0x00000040
#define LmIMEMBISTDN 0x00000020 /* ro */
#define LmIMEMBISTFAIL 0x00000010 /* ro */
#define LmSCRBISTEN 0x00000004
#define LmSCRBISTDN 0x00000002 /* ro */
#define LmSCRBISTFAIL 0x00000001 /* ro */
#define LmRAMPAGE (LmRAMPAGE1 + LmRAMPAGE0)
#define LmRAMPAGE_LSHIFT 0x8
#define LmSCRATCH(LinkNum) (LSEQ0_HOST_REG_BASE_ADR + \
((LinkNum) * LmSEQ_HOST_REG_SIZE) +\
MAPPEDSCR)
#define LmSEQRAM(LinkNum) (LSEQ0_HOST_REG_BASE_ADR + \
((LinkNum) * LmSEQ_HOST_REG_SIZE) +\
LSEQRAM)
/*
* LmSEQ CIO Bus Register, Address Range : (0x0000-0xFFC)
* 8 modes, each mode is 512 bytes.
* Unless specified, the register should valid for all modes.
*/
#define LmSEQ_CIOBUS_REG_BASE 0x2000
#define LmSEQ_PHY_BASE(Mode, LinkNum) \
(LSEQ0_HOST_REG_BASE_ADR + \
(LmSEQ_HOST_REG_SIZE * (u32) (LinkNum)) + \
LmSEQ_CIOBUS_REG_BASE + \
((u32) (Mode) * LmSEQ_MODE_PAGE_SIZE))
#define LmSEQ_PHY_REG(Mode, LinkNum, Reg) \
(LmSEQ_PHY_BASE(Mode, LinkNum) + (u32) (Reg))
#define LmMODEPTR(LinkNum) LmSEQ_PHY_REG(0, LinkNum, MODEPTR)
#define LmALTMODE(LinkNum) LmSEQ_PHY_REG(0, LinkNum, ALTMODE)
#define LmATOMICXCHG(LinkNum) LmSEQ_PHY_REG(0, LinkNum, ATOMICXCHG)
#define LmFLAG(LinkNum) LmSEQ_PHY_REG(0, LinkNum, FLAG)
#define LmARP2INTCTL(LinkNum) LmSEQ_PHY_REG(0, LinkNum, ARP2INTCTL)
#define LmSTACK(LinkNum) LmSEQ_PHY_REG(0, LinkNum, STACK)
#define LmFUNCTION1(LinkNum) LmSEQ_PHY_REG(0, LinkNum, FUNCTION1)
#define LmPRGMCNT(LinkNum) LmSEQ_PHY_REG(0, LinkNum, PRGMCNT)
#define LmACCUM(LinkNum) LmSEQ_PHY_REG(0, LinkNum, ACCUM)
#define LmSINDEX(LinkNum) LmSEQ_PHY_REG(0, LinkNum, SINDEX)
#define LmDINDEX(LinkNum) LmSEQ_PHY_REG(0, LinkNum, DINDEX)
#define LmALLONES(LinkNum) LmSEQ_PHY_REG(0, LinkNum, ALLONES)
#define LmALLZEROS(LinkNum) LmSEQ_PHY_REG(0, LinkNum, ALLZEROS)
#define LmSINDIR(LinkNum) LmSEQ_PHY_REG(0, LinkNum, SINDIR)
#define LmDINDIR(LinkNum) LmSEQ_PHY_REG(0, LinkNum, DINDIR)
#define LmJUMLDIR(LinkNum) LmSEQ_PHY_REG(0, LinkNum, JUMLDIR)
#define LmARP2HALTCODE(LinkNum) LmSEQ_PHY_REG(0, LinkNum, ARP2HALTCODE)
#define LmCURRADDR(LinkNum) LmSEQ_PHY_REG(0, LinkNum, CURRADDR)
#define LmLASTADDR(LinkNum) LmSEQ_PHY_REG(0, LinkNum, LASTADDR)
#define LmNXTLADDR(LinkNum) LmSEQ_PHY_REG(0, LinkNum, NXTLADDR)
#define LmDBGPORTPTR(LinkNum) LmSEQ_PHY_REG(0, LinkNum, DBGPORTPTR)
#define LmDBGPORT(LinkNum) LmSEQ_PHY_REG(0, LinkNum, DBGPORT)
#define LmSCRATCHPAGE(LinkNum) LmSEQ_PHY_REG(0, LinkNum, SCRATCHPAGE)
#define LmMnSCRATCHPAGE(LinkNum, Mode) LmSEQ_PHY_REG(Mode, LinkNum, \
MnSCRATCHPAGE)
#define LmTIMERCALC(LinkNum) LmSEQ_PHY_REG(0, LinkNum, 0x28)
#define LmREQMBX(LinkNum) LmSEQ_PHY_REG(0, LinkNum, 0x30)
#define LmRSPMBX(LinkNum) LmSEQ_PHY_REG(0, LinkNum, 0x34)
#define LmMnINT(LinkNum, Mode) LmSEQ_PHY_REG(Mode, LinkNum, 0x38)
#define CTXMEMSIZE 0x80000000 /* ro */
#define LmACKREQ 0x08000000
#define LmNAKREQ 0x04000000
#define LmMnXMTERR 0x02000000
#define LmM5OOBSVC 0x01000000
#define LmHWTINT 0x00800000
#define LmMnCTXDONE 0x00100000
#define LmM2REQMBXF 0x00080000
#define LmM2RSPMBXE 0x00040000
#define LmMnDMAERR 0x00020000
#define LmRCVPRIM 0x00010000
#define LmRCVERR 0x00008000
#define LmADDRRCV 0x00004000
#define LmMnHDRMISS 0x00002000
#define LmMnWAITSCB 0x00001000
#define LmMnRLSSCB 0x00000800
#define LmMnSAVECTX 0x00000400
#define LmMnFETCHSG 0x00000200
#define LmMnLOADCTX 0x00000100
#define LmMnCFGICL 0x00000080
#define LmMnCFGSATA 0x00000040
#define LmMnCFGEXPSATA 0x00000020
#define LmMnCFGCMPLT 0x00000010
#define LmMnCFGRBUF 0x00000008
#define LmMnSAVETTR 0x00000004
#define LmMnCFGRDAT 0x00000002
#define LmMnCFGHDR 0x00000001
#define LmMnINTEN(LinkNum, Mode) LmSEQ_PHY_REG(Mode, LinkNum, 0x3C)
#define EN_LmACKREQ 0x08000000
#define EN_LmNAKREQ 0x04000000
#define EN_LmMnXMTERR 0x02000000
#define EN_LmM5OOBSVC 0x01000000
#define EN_LmHWTINT 0x00800000
#define EN_LmMnCTXDONE 0x00100000
#define EN_LmM2REQMBXF 0x00080000
#define EN_LmM2RSPMBXE 0x00040000
#define EN_LmMnDMAERR 0x00020000
#define EN_LmRCVPRIM 0x00010000
#define EN_LmRCVERR 0x00008000
#define EN_LmADDRRCV 0x00004000
#define EN_LmMnHDRMISS 0x00002000
#define EN_LmMnWAITSCB 0x00001000
#define EN_LmMnRLSSCB 0x00000800
#define EN_LmMnSAVECTX 0x00000400
#define EN_LmMnFETCHSG 0x00000200
#define EN_LmMnLOADCTX 0x00000100
#define EN_LmMnCFGICL 0x00000080
#define EN_LmMnCFGSATA 0x00000040
#define EN_LmMnCFGEXPSATA 0x00000020
#define EN_LmMnCFGCMPLT 0x00000010
#define EN_LmMnCFGRBUF 0x00000008
#define EN_LmMnSAVETTR 0x00000004
#define EN_LmMnCFGRDAT 0x00000002
#define EN_LmMnCFGHDR 0x00000001
#define LmM0INTEN_MASK (EN_LmMnCFGCMPLT | EN_LmMnCFGRBUF | \
EN_LmMnSAVETTR | EN_LmMnCFGRDAT | \
EN_LmMnCFGHDR | EN_LmRCVERR | \
EN_LmADDRRCV | EN_LmMnHDRMISS | \
EN_LmMnRLSSCB | EN_LmMnSAVECTX | \
EN_LmMnFETCHSG | EN_LmMnLOADCTX | \
EN_LmHWTINT | EN_LmMnCTXDONE | \
EN_LmRCVPRIM | EN_LmMnCFGSATA | \
EN_LmMnCFGEXPSATA | EN_LmMnDMAERR)
#define LmM1INTEN_MASK (EN_LmMnCFGCMPLT | EN_LmADDRRCV | \
EN_LmMnRLSSCB | EN_LmMnSAVECTX | \
EN_LmMnFETCHSG | EN_LmMnLOADCTX | \
EN_LmMnXMTERR | EN_LmHWTINT | \
EN_LmMnCTXDONE | EN_LmRCVPRIM | \
EN_LmRCVERR | EN_LmMnDMAERR)
#define LmM2INTEN_MASK (EN_LmADDRRCV | EN_LmHWTINT | \
EN_LmM2REQMBXF | EN_LmRCVPRIM | \
EN_LmRCVERR)
#define LmM5INTEN_MASK (EN_LmADDRRCV | EN_LmM5OOBSVC | \
EN_LmHWTINT | EN_LmRCVPRIM | \
EN_LmRCVERR)
#define LmXMTPRIMD(LinkNum) LmSEQ_PHY_REG(0, LinkNum, 0x40)
#define LmXMTPRIMCS(LinkNum) LmSEQ_PHY_REG(0, LinkNum, 0x44)