Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / obp / obp / dev / sun4v-devices / ldc / ldc-struct.fth
CommitLineData
920dae64
AT
1\ ========== Copyright Header Begin ==========================================
2\
3\ Hypervisor Software File: ldc-struct.fth
4\
5\ Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
6\
7\ - Do no alter or remove copyright notices
8\
9\ - Redistribution and use of this software in source and binary forms, with
10\ or without modification, are permitted provided that the following
11\ conditions are met:
12\
13\ - Redistribution of source code must retain the above copyright notice,
14\ this list of conditions and the following disclaimer.
15\
16\ - Redistribution in binary form must reproduce the above copyright notice,
17\ this list of conditions and the following disclaimer in the
18\ documentation and/or other materials provided with the distribution.
19\
20\ Neither the name of Sun Microsystems, Inc. or the names of contributors
21\ may be used to endorse or promote products derived from this software
22\ without specific prior written permission.
23\
24\ This software is provided "AS IS," without a warranty of any kind.
25\ ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
26\ INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
27\ PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
28\ MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
29\ ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
30\ DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN
31\ OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR
32\ FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
33\ DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
34\ ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
35\ SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
36\
37\ You acknowledge that this software is not designed, licensed or
38\ intended for use in the design, construction, operation or maintenance of
39\ any nuclear facility.
40\
41\ ========== Copyright Header End ============================================
42id: @(#)ldc-struct.fth 1.4 07/04/10
43purpose: Implements logical Domain Communication
44copyright: Copyright 2007 Sun Microsystems, Inc. All Rights Reserved
45copyright: Use is subject to license terms.
46
47\ Hypervisor APIs
48h# e0 constant tt-ldc-tx-qconf
49h# e1 constant tt-ldc-tx-qinfo
50h# e2 constant tt-ldc-tx-get-state
51h# e3 constant tt-ldc-tx-set-qtail
52h# e4 constant tt-ldc-rx-qconf
53h# e5 constant tt-ldc-rx-qinfo
54h# e6 constant tt-ldc-rx-get-state
55h# e7 constant tt-ldc-rx-set-qhead
56h# ea constant tt-ldc-set-map-table
57h# eb constant tt-ldc-get-map-table
58h# ec constant tt-ldc-copy
59h# ed constant tt-ldc-mapin
60h# ee constant tt-ldc-unmap
61h# ef constant tt-ldc-revoke
62
63d# 48 constant max-ldc-payload-reli
64d# 56 constant max-ldc-payload-unreli
65d# 64 constant /ldc-msg-pkt
66
67defer max-ldc-payload ' max-ldc-payload-unreli is max-ldc-payload
68
69d# 2000 constant max-ldc-chan-ids
70
71\ Reliable Datagram Packet:
72\ 6 3 3 2 2 1 1
73\ 3 2 1 4 3 6 5 8 7 0
74\ +------------------------+-----+-----+------+------+
75\ word 0: | msgid | env | ctrl| stype| type |
76\ +------------------------+-----+-----+------+------+
77\ word 1: | ackid | version/reserved |
78\ +--------------------------------------------------+
79\ word 2-7 | data payload |
80\ +--------------------------------------------------+
81
82struct
83 /c field >ldc-type
84 /c field >ldc-stype
85 /c field >ldc-ctrl
86 /c field >ldc-env
87 /l field >ldc-msgid
88constant /ldc-header-common
89
90struct
91 /ldc-header-common field >ldc-hd-common
92dup constant /ldc-data-unreli
93\ By default assume unreliable transport, the offset will be set appropriately
94\ later on
95 value ldc-data-off
96
97struct
98 /ldc-header-common field >ldc-hd-common1
99 /l field >ldc-reserved
100 /l field >ldc-ackid
101constant /ldc-data-reli
102
103\ The reserved field actually holds version information in the first couple
104\ packets exchanged.... For data transfers the field is reserved.
105alias >ldc-version >ldc-reserved
106
107
1086 constant ldc-msg-pkt-shift
109
110\ LDC Base_raddr must be aligned exactly to match the queue size,
111\ 4k entries X 64 bytes/pkt = 256K queue size
112h# 1000 constant ldc-queue-entries
113/ldc-msg-pkt ldc-queue-entries * constant ldc-queue-size
114
115\ Define LDC Message Types, for the >ldc-type field
1161 constant ldc-ctrl-type
1172 constant ldc-data-type
118h# 10 constant ldc-err-type
119
120\ LDC Message Subtypes
1211 constant ldc-info
1222 constant ldc-ack
1234 constant ldc-nack
124
125\ Define LDC Ctrl messages, for the >ldc-ctrl field
1261 constant ldc-ver \ Version message
1272 constant ldc-rts \ request to send
1283 constant ldc-rtr \ ready to receive
1294 constant ldc-rdx \ Ready for Data eXchange
130
131\ LDC error messages
132h# 10 constant ldc-inv-session
133h# 20 constant ldc-inv-ver
134h# 30 constant ldc-inv-pkt
135
136\ LDC States
1370 constant ldc-down
1381 constant ldc-up
1392 constant ldc-reset
140
141\ LDC Error code
142h# ffff constant LDC-NOTUP
143
144\ Protocol type
1450 constant ldc-mode-raw
1461 constant ldc-mode-unreliable
147\ 2 (reserved)
1483 constant ldc-mode-reliable
149
150\ Packet Envelope: For data bearing LDC packets, indicate the number of
151\ bytes of data in the current packet.
152\ 'start/stop' field indicates whether the data is a fragment
153\ in a multi-packet transfer.
154\ The last packet in a multi-packet transfer is indicated using 'stop' bit.
155
156\ 3 3 2 2
157\ 1 0 9 4
158\ +-------+-------+-------+-------+-------+
159\ | stop | start | pkt_size |
160\ +-------+-------+-------+-------+-------+
161
162\ Packets between start & stop does not have any bit set, single packet
163\ has both bits set.
164h# 40 constant start-pkt-bit
165h# 80 constant stop-pkt-bit
166h# 3f constant pkt-size-mask
167h# c0 constant multi-bit-mask
168
169\ Internal LDC Msg ctrl Codes
1701 constant ldc-bulk-xfer
171
172struct
173 /l field >ldc-chan-id
174 /l field >ldc-chan-used
175 /l field >ldc-chan-pad1
176 /l field >ldc-chan-pad2
177constant /ldc-chan-state
178
179h# 2000 constant pagesize
180d# 13 constant pagesizeshift
1810 constant pagesize8K
182
183\ LDC Map Table Entry
184\
185\ 63 57 56 55 13 12 11 10 9 8 7 6 5 4 3 0
186\ +------+--------+---------+-----+----+---+---+---+---+--+--+--+-------+
187\ | rsvd | in-use | raddr | sw1 |sw2 |cpw|cpr|iow|ior|x |w |r | pgsz |
188\ +------+--------+---------+-----+----+---+---+---+---+--+--+--+-------+
189\ | revocation cookie |
190\ +---------------------------------------------------------------------+
191
192struct
193 /x field >ldc-mt-ent1
194 /x field >ldc-mt-rcookie
195constant /ldc-mt-ent
196
197d# 9 constant ldc-cprw-shift
198d# 13 constant ldcmtbl-ra-shift
199 6 constant num-cookies \ max # of cookies in map table
200
2013 ldc-cprw-shift << pagesize8K or constant mt-entry-misc
202
203h# ffff.e000 h# 0fff.ffff lxjoin constant mt-ra-mask
204
205\ LDC Cookie address format
206\ 6 6 5
207\ |3 0|9 size|size-1 0|
208\ +------+------------------------------+-------------------+
209\ | pgsz | table_idx | page_offset |
210\ +------+------------------------------+-------------------+
211
212d# 60 constant cookie-pgsz-shift
213
214\ LDC Memory xfer related
215
216\ LDC Memory Copy Direction
2170 constant ldc-mcopy-in \ Copy data to VA from cookie-memory
2181 constant ldc-mcopy-out \ Copy data from VA to cookie-memory
219
220headerless
221