Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | /* |
2 | * ========== Copyright Header Begin ========================================== | |
3 | * | |
4 | * OpenSPARC T2 Processor File: niu_pio_regs3.s | |
5 | * Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved | |
6 | * 4150 Network Circle, Santa Clara, California 95054, U.S.A. | |
7 | * | |
8 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
9 | * | |
10 | * This program is free software; you can redistribute it and/or modify | |
11 | * it under the terms of the GNU General Public License as published by | |
12 | * the Free Software Foundation; version 2 of the License. | |
13 | * | |
14 | * This program is distributed in the hope that it will be useful, | |
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | * GNU General Public License for more details. | |
18 | * | |
19 | * You should have received a copy of the GNU General Public License | |
20 | * along with this program; if not, write to the Free Software | |
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
22 | * | |
23 | * For the avoidance of doubt, and except that if any non-GPL license | |
24 | * choice is available it will apply instead, Sun elects to use only | |
25 | * the General Public License version 2 (GPLv2) at this time for any | |
26 | * software where a choice of GPL license versions is made | |
27 | * available with the language indicating that GPLv2 or any later version | |
28 | * may be used, or where a choice of which version of the GPL is applied is | |
29 | * otherwise unspecified. | |
30 | * | |
31 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, | |
32 | * CA 95054 USA or visit www.sun.com if you need additional information or | |
33 | * have any questions. | |
34 | * | |
35 | * | |
36 | * ========== Copyright Header End ============================================ | |
37 | */ | |
38 | #define MAIN_PAGE_NUCLEUS_ALSO | |
39 | #define MAIN_PAGE_HV_ALSO | |
40 | ||
41 | #include "hboot.s" | |
42 | !#include "asi_s.h" | |
43 | ||
44 | ||
45 | ||
46 | ||
47 | #define FZC_PIO_BASE_ADDRESS 0x080000 | |
48 | #define NIU_BASE_ADDRESS 0x8100000000 | |
49 | #define PIO_ADDRESS_RANGE mpeval(NIU_BASE_ADDRESS + FZC_PIO_BASE_ADDRESS) | |
50 | ||
51 | #define PIO_DMA_BIND 0x10000 | |
52 | #define PIO_LDG_NUM 0x20000 | |
53 | #define PIO_LDGITMRES 0x00008 | |
54 | #define PIO_SID 0x10200 | |
55 | #define PIO_SMX_CFIG_DAT 0x00040 | |
56 | #define PIO_SMX_CTL 0x00050 | |
57 | #define PIO_SMX_DBG_VEC 0x00058 | |
58 | #define PIO_DBG_SEL 0x00060 | |
59 | #define PIO_TRAIN_VEC 0x00068 | |
60 | #define PIO_ARB_CTL 0x00070 | |
61 | #define PIO_ARB_DBG_VEC 0x00078 | |
62 | ||
63 | #define DMA_BIND mpeval(PIO_ADDRESS_RANGE + PIO_DMA_BIND) | |
64 | #define LDG_NUM mpeval(PIO_ADDRESS_RANGE + PIO_LDG_NUM) | |
65 | #define LDGITMRES mpeval(PIO_ADDRESS_RANGE + PIO_LDGITMRES) | |
66 | #define SID mpeval(PIO_ADDRESS_RANGE + PIO_SID) | |
67 | #define ARB_CTL mpeval(PIO_ADDRESS_RANGE + PIO_ARB_CTL) | |
68 | #define ARB_DBG_VEC mpeval(PIO_ADDRESS_RANGE + PIO_ARB_DBG_VEC) | |
69 | #define SMX_CTL mpeval(PIO_ADDRESS_RANGE + PIO_SMX_CTL) | |
70 | #define SMX_DBG_VEC mpeval(PIO_ADDRESS_RANGE + PIO_SMX_DBG_VEC) | |
71 | #define DBG_SEL mpeval(PIO_ADDRESS_RANGE + PIO_DBG_SEL) | |
72 | #define TRAIN_VEC mpeval(PIO_ADDRESS_RANGE + PIO_TRAIN_VEC) | |
73 | #define SMX_CFIG_DAT mpeval(PIO_ADDRESS_RANGE + PIO_SMX_CFIG_DAT) | |
74 | ||
75 | #define DMA_BIND_DATA_MASK 0x0000000000003f3f | |
76 | #define DATA_EN_32BITS 0x00000000ffffffff | |
77 | #define DATA_EN_20BITS 0x00000000000fffff | |
78 | #define DATA_EN_6BITS 0x000000000000003f | |
79 | #define DATA_EN_7BITS 0x000000000000007f | |
80 | #define SMX_CFIG_DAT_DATA_MASK 0x00000000cfffffff | |
81 | ||
82 | .text | |
83 | .global main | |
84 | ||
85 | ||
86 | main: | |
87 | ta T_CHANGE_HPRIV | |
88 | ||
89 | get_th_id: | |
90 | ta T_RD_THID | |
91 | ||
92 | // cmp %o1,0x0 | |
93 | // bne test_pass | |
94 | nop | |
95 | ||
96 | !Write then read data of PIO_SID count 69 step 8 | |
97 | setx SID,%g7,%g1 | |
98 | setx wdata,%g7,%g2 | |
99 | set 64,%g8 | |
100 | ||
101 | loop14: | |
102 | set 0x05,%g3 | |
103 | loop15: | |
104 | ldx [%g2],%g4 | |
105 | stxa %g4,[%g1]ASI_PRIMARY_LITTLE | |
106 | ||
107 | ldxa [%g1]ASI_PRIMARY_LITTLE, %g5 | |
108 | setx DATA_EN_7BITS, %g7, %g6 | |
109 | and %g4, %g6, %g4 | |
110 | ||
111 | cmp %g4, %g5 | |
112 | ||
113 | bne %xcc, test_fail | |
114 | ||
115 | ||
116 | add %g2,8,%g2 | |
117 | sub %g3,1,%g3 | |
118 | cmp %g3,%g0 | |
119 | bne loop15 | |
120 | nop | |
121 | add %g1,8,%g1 | |
122 | sub %g8,1,%g8 | |
123 | cmp %g8,%g0 | |
124 | bne loop14 | |
125 | nop | |
126 | ||
127 | ||
128 | ||
129 | ||
130 | ||
131 | /****************************************************** | |
132 | * Exit code | |
133 | *******************************************************/ | |
134 | ||
135 | test_pass: | |
136 | EXIT_GOOD | |
137 | ||
138 | test_fail: | |
139 | EXIT_BAD | |
140 | ||
141 | ||
142 | .data | |
143 | .align 0x100 | |
144 | wdata: | |
145 | .xword 0xffffffffffffffff | |
146 | .xword 0xaaaaaaaaaaaaaaaa | |
147 | .xword 0x0000000000000000 | |
148 | .xword 0x5555555555555555 | |
149 | .xword 0x0123456789abcdef | |
150 | ||
151 | .end |