omega-gpu-driver
aien-dev/omega-gpu-driver
Brought by drakestapleton
omega-gpu-driver / rm / model.om
| 1 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | note Fixture packed at t3000, 4352 bytes. Prefix HOST_MODEL version1; never device truth. |
| 3 | note Local vendor routes: nv.c2523 CARD_INFO; gpu_mgr.c2527 ID_INFO_V2; |
| 4 | note device_ctrl.c56 classlist; gpu.c5036 cached GID. Static GR data originates |
| 5 | note in rpc76 GSP_RM_CONTROL(INTERNAL_STATIC_KGR_GET_INFO 0x20800a2a), |
| 6 | note kernel_graphics.c1227, ctrl2080internal.h422, OGKM580.173.02. |
| 7 | fn rmfx t view ulong 4096 off ulong to uchar |
| 8 | idx = add 3000 div off 8 |
| 9 | shift = mul rem off 8 8 |
| 10 | v = shr get t idx shift |
| 11 | ret uchar and v 255 |
| 12 | end |
| 13 | fn rmfc t view ulong 4096 b edit uchar 16384 dst ulong src ulong n ulong to void |
| 14 | for j ulong n |
| 15 | put b add dst j rmfx t add src j |
| 16 | end |
| 17 | end |
| 18 | fn rmfxrpc t view ulong 4096 to bool |
| 19 | rqinit |
| 20 | rqpeer |
| 21 | rqclear 3752 |
| 22 | rqput32 4 8 545262122 |
| 23 | rqput32 4 16 3712 |
| 24 | r = rqsend 76 3752 3752 true |
| 25 | if ne r 0 |
| 26 | ret false |
| 27 | end |
| 28 | for j ulong 4096 |
| 29 | put rqstat add 4096 j rmfx t add 256 j |
| 30 | end |
| 31 | rqput32 1 16 1 |
| 32 | if ne rqrecv 1 |
| 33 | ret false |
| 34 | end |
| 35 | if or ne get rqfun 0 76 ne get rqres 0 0 |
| 36 | ret false |
| 37 | end |
| 38 | if or ne get rqlen 0 3752 ne rqget32 3 88 545262122 |
| 39 | ret false |
| 40 | end |
| 41 | ret and eq rqget32 3 96 3712 eq get rqreply 0 ulong 0 |
| 42 | end |
| 43 | fn rmfload t edit ulong 4096 b edit uchar 16384 to bool |
| 44 | n = argread 3 b 0 4096 |
| 45 | if or le n 1 ge n 4096 |
| 46 | ret false |
| 47 | end |
| 48 | fd = fopen b 0 ulong n 524288 0 |
| 49 | if lt fd 0 |
| 50 | ret false |
| 51 | end |
| 52 | pos = ulong 0 |
| 53 | while lt pos 4352 bound 4352 |
| 54 | r = read int fd b pos sub ulong 4352 pos |
| 55 | if le r 0 |
| 56 | z = fclose int fd |
| 57 | ret false |
| 58 | end |
| 59 | pos = add pos ulong r |
| 60 | end |
| 61 | r = read int fd b 4352 1 |
| 62 | z = fclose int fd |
| 63 | if ne r 0 |
| 64 | ret false |
| 65 | end |
| 66 | if or ne rmget b 0 8 ulong 4922237989571219272 ne rmget b 8 8 ulong 674885 |
| 67 | ret false |
| 68 | end |
| 69 | for j ulong 544 |
| 70 | put t add 3000 j rmget b mul j 8 8 |
| 71 | end |
| 72 | ret rmfxrpc t |
| 73 | end |
| 74 | fn rmhostct t edit ulong 4096 b edit uchar 16384 a view ulong 8 to ulong |
| 75 | cmd = get a 2 |
| 76 | slot = rmfind t get a 0 get a 1 |
| 77 | if eq slot 64 |
| 78 | ret 2 |
| 79 | end |
| 80 | cls = get t add mul slot 5 4 |
| 81 | if eq cmd 517 |
| 82 | if or ne cls 65 ne rmget b 104 4 1 |
| 83 | ret 3 |
| 84 | end |
| 85 | rmfc t b 104 88 32 |
| 86 | ret 0 |
| 87 | end |
| 88 | if eq cmd 8389121 |
| 89 | if ne cls 128 |
| 90 | ret 3 |
| 91 | end |
| 92 | n = rmget b 104 4 |
| 93 | if ne n 0 |
| 94 | if lt n 3 |
| 95 | ret 1 |
| 96 | end |
| 97 | rmfc t b 120 124 12 |
| 98 | end |
| 99 | rmput b 104 4 3 |
| 100 | ret 0 |
| 101 | end |
| 102 | if eq cmd 545264129 |
| 103 | if ne cls 8320 |
| 104 | ret 3 |
| 105 | end |
| 106 | if ne rmget b 104 4 1 |
| 107 | ret 1 |
| 108 | end |
| 109 | if ne rmget b 136 4 12 |
| 110 | ret 6 |
| 111 | end |
| 112 | if not rmfxrpc t |
| 113 | ret 6 |
| 114 | end |
| 115 | rmput b 140 4 rqget32 3 220 |
| 116 | ret 0 |
| 117 | end |
| 118 | if eq cmd 545259850 |
| 119 | if ne cls 8320 |
| 120 | ret 3 |
| 121 | end |
| 122 | if or ne rmget b 104 4 0 or ne rmget b 108 4 2 lt rmget b 112 4 16 |
| 123 | ret 1 |
| 124 | end |
| 125 | rmput b 112 4 16 |
| 126 | rmfc t b 116 136 16 |
| 127 | ret 0 |
| 128 | end |
| 129 | ret 6 |
| 130 | end |
| 131 | fn rmhostio t view ulong 4096 b edit uchar 16384 nr ulong to long |
| 132 | if eq nr 200 |
| 133 | for j ulong 4608 |
| 134 | put b add 72 j 0 |
| 135 | end |
| 136 | rmfc t b 72 16 72 |
| 137 | ret 0 |
| 138 | end |
| 139 | if eq nr 210 |
| 140 | for j ulong 64 |
| 141 | put b add 80 j 0 |
| 142 | end |
| 143 | rmput b 76 4 1 |
| 144 | note ogd HOST_MODEL; not NVIDIA version and no vendor compatibility claim. |
| 145 | rmput b 80 8 6076287493452621679 |
| 146 | rmput b 88 8 3544135292146371935 |
| 147 | ret 0 |
| 148 | end |
| 149 | ret -95 |
| 150 | end |