summaryrefslogtreecommitdiff
path: root/shared-core/nv50_graph.c
blob: 1300c83ae1722cd8fac4492a38ab15841f92d41a (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
		++table->hits;
	    }
	    return bucket;
	}
	prev = bucket;
    }
    ++table->misses;
    return NULL;
}

int drmHashLookup(void *t, unsigned long key, void **value)
{
    HashTablePtr  table = (HashTablePtr)t;
    HashBucketPtr bucket;

    if (!table || table->magic != HASH_MAGIC) return -1; /* Bad magic */

    bucket = HashFind(table, key, NULL);
    if (!bucket) return 1;	/* Not found */
    *value = bucket->value;
    return 0;			/* Found */
}

int drmHashInsert(void *t, unsigned long key, void *value)
{
    HashTablePtr  table = (HashTablePtr)t;
    HashBucketPtr bucket;
    unsigned long hash;

    if (table->magic != HASH_MAGIC) return -1; /* Bad magic */

    if (HashFind(table, key, &hash)) return 1; /* Already in table */

    bucket               = HASH_ALLOC(sizeof(*bucket));
    if (!bucket) return -1;	/* Error */
    bucket->key          = key;
    bucket->value        = value;
    bucket->next         = table->buckets[hash];
    table->buckets[hash] = bucket;
#if HASH_DEBUG
    printf("Inserted %d at %d/%p\n", key, hash, bucket);
#endif
    return 0;			/* Added to table */
}

int drmHashDelete(void *t, unsigned long key)
{
    HashTablePtr  table = (HashTablePtr)t;
    unsigned long hash;
    HashBucketPtr bucket;

    if (table->magic != HASH_MAGIC) return -1; /* Bad magic */

    bucket = HashFind(table, key, &hash);

    if (!bucket) return 1;	/* Not found */

    table->buckets[hash] = bucket->next;
    HASH_FREE(bucket);
    return 0;
}

int drmHashNext(void *t, unsigned long *key, void **value)
{
    HashTablePtr  table = (HashTablePtr)t;

    while (table->p0 < HASH_SIZE) {
	if (table->p1) {
	    *key       = table->p1->key;
	    *value     = table->p1->value;
	    table->p1  = table->p1->next;
	    return 1;
	}
	table->p1 = table->buckets[table->p0];
	++table->p0;
    }
    return 0;
}

int drmHashFirst(void *t, unsigned long *key, void **value)
{
    HashTablePtr  table = (HashTablePtr)t;

    if (table->magic != HASH_MAGIC) return -1; /* Bad magic */

    table->p0 = 0;
    table->p1 = table->buckets[0];
    return drmHashNext(table, key, value);
}

#if HASH_MAIN
#define DIST_LIMIT 10
static int dist[DIST_LIMIT];

static void clear_dist(void) {
    int i;

    for (i = 0; i < DIST_LIMIT; i++) dist[i] = 0;
}

static int count_entries(HashBucketPtr bucket)
{
    int count = 0;

    for (; bucket; bucket = bucket->next) ++count;
    return count;
}

static void update_dist(int count)
{
    if (count >= DIST_LIMIT) ++dist[DIST_LIMIT-1];
    else                     ++dist[count];
}

static void compute_dist(HashTablePtr table)
{
    int           i;
    HashBucketPtr bucket;

    printf("Entries = %ld, hits = %ld, partials = %ld, misses = %ld\n",
	   table->entries, table->hits, table->partials, table->misses);
    clear_dist();
    for (i = 0; i < HASH_SIZE; i++) {
	bucket = table->buckets[i];
	update_dist(count_entries(bucket));
    }
    for (i = 0; i < DIST_LIMIT; i++) {
	if (i != DIST_LIMIT-1) printf("%5d %10d\n", i, dist[i]);
	else                   printf("other %10d\n", dist[i]);
    }
}

static void check_table(HashTablePtr table,
			unsigned long key, unsigned long value)
{
    unsigned long retval  = 0;
    int           retcode = drmHashLookup(table, key, &retval);

    switch (retcode) {
    case -1:
	printf("Bad magic = 0x%08lx:"
	       " key = %lu, expected = %lu, returned = %lu\n",
	       table->magic, key, value, retval);
	break;
    case 1:
	printf("Not found: key = %lu, expected = %lu returned = %lu\n",
	       key, value, retval);
	break;
    case 0:
	if (value != retval)
	    printf("Bad value: key = %lu, expected = %lu, returned = %lu\n",
		   key, value, retval);
	break;
    default:
	printf("Bad retcode = %d: key = %lu, expected = %lu, returned = %lu\n",
	       retcode, key, value, retval);
	break;
    }
}

int main(void)
{
    HashTablePtr table;
    int          i;

    printf("\n***** 256 consecutive integers ****\n");
    table = drmHashCreate();
    for (i = 0; i < 256; i++) drmHashInsert(table, i, i);
    for (i = 0; i < 256; i++) check_table(table, i, i);
    for (i = 256; i >= 0; i--) check_table(table, i, i);
    compute_dist(table);
    drmHashDestroy(table);

    printf("\n***** 1024 consecutive integers ****\n");
    table = drmHashCreate();
    for (i = 0; i < 1024; i++) drmHashInsert(table, i, i);
    for (i = 0; i < 1024; i++) check_table(table, i, i);
    for (i = 1024; i >= 0; i--) check_table(table, i, i);
    compute_dist(table);
    drmHashDestroy(table);

    printf("\n***** 1024 consecutive page addresses (4k pages) ****\n");
    table = drmHashCreate();
    for (i = 0; i < 1024; i++) drmHashInsert(table, i*4096, i);
    for (i = 0; i < 1024; i++) check_table(table, i*4096, i);
    for (i = 1024; i >= 0; i--) check_table(table, i*4096, i);
    compute_dist(table);
    drmHashDestroy(table);

    printf("\n***** 1024 random integers ****\n");
    table = drmHashCreate();
    srandom(0xbeefbeef);
    for (i = 0; i < 1024; i++) drmHashInsert(table, random(), i);
    srandom(0xbeefbeef);
    for (i = 0; i < 1024; i++) check_table(table, random(), i);
    srandom(0xbeefbeef);
    for (i = 0; i < 1024; i++) check_table(table, random(), i);
    compute_dist(table);
    drmHashDestroy(table);

    printf("\n***** 5000 random integers ****\n");
    table = drmHashCreate();
    srandom(0xbeefbeef);
    for (i = 0; i < 5000; i++) drmHashInsert(table, random(), i);
    srandom(0xbeefbeef);
    for (i = 0; i < 5000; i++) check_table(table, random(), i);
    srandom(0xbeefbeef);
    for (i = 0; i < 5000; i++) check_table(table, random(), i);
    compute_dist(table);
    drmHashDestroy(table);

    return 0;
}
#endif
n1825' href='#n1825'>1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196
/*
 * Copyright (C) 2007 Ben Skeggs.
 * All Rights Reserved.
 *
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 *
 * The above copyright notice and this permission notice (including the
 * next paragraph) shall be included in all copies or substantial
 * portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 *
 */

#include "drmP.h"
#include "drm.h"
#include "nouveau_drv.h"

#define IS_G80 ((dev_priv->chipset & 0xf0) == 0x50)

static void
nv50_graph_init_reset(struct drm_device *dev)
{
	struct drm_nouveau_private *dev_priv = dev->dev_private;
	uint32_t pmc_e = NV_PMC_ENABLE_PGRAPH | (1 << 21);

	DRM_DEBUG("\n");

	NV_WRITE(NV03_PMC_ENABLE, NV_READ(NV03_PMC_ENABLE) & ~pmc_e);
	NV_WRITE(NV03_PMC_ENABLE, NV_READ(NV03_PMC_ENABLE) |  pmc_e);
}

static void
nv50_graph_init_intr(struct drm_device *dev)
{
	struct drm_nouveau_private *dev_priv = dev->dev_private;

	DRM_DEBUG("\n");
	NV_WRITE(NV03_PGRAPH_INTR, 0xffffffff);
	NV_WRITE(0x400138, 0xffffffff);
	NV_WRITE(NV40_PGRAPH_INTR_EN, 0xffffffff);
}

static void
nv50_graph_init_regs__nv(struct drm_device *dev)
{
	struct drm_nouveau_private *dev_priv = dev->dev_private;

	DRM_DEBUG("\n");

	NV_WRITE(0x400804, 0xc0000000);
	NV_WRITE(0x406800, 0xc0000000);
	NV_WRITE(0x400c04, 0xc0000000);
	NV_WRITE(0x401804, 0xc0000000);
	NV_WRITE(0x405018, 0xc0000000);
	NV_WRITE(0x402000, 0xc0000000);

	NV_WRITE(0x400108, 0xffffffff);

	NV_WRITE(0x400824, 0x00004000);
	NV_WRITE(0x400500, 0x00010001);
}

static void
nv50_graph_init_regs(struct drm_device *dev)
{
	struct drm_nouveau_private *dev_priv = dev->dev_private;

	DRM_DEBUG("\n");

	NV_WRITE(NV04_PGRAPH_DEBUG_3, (1<<2) /* HW_CONTEXT_SWITCH_ENABLED */);
}

static uint32_t nv84_ctx_voodoo[] = {
	0x0070008e, 0x0070009c, 0x00200020, 0x00600008, 0x0050004c, 0x00400e89,
	0x00200000, 0x00600007, 0x00300000, 0x00c000ff, 0x00200000, 0x008000ff,
	0x00700009, 0x0041634d, 0x00402944, 0x00402905, 0x0040290d, 0x00413e06,
	0x00600005, 0x004015c5, 0x00600011, 0x0040270b, 0x004021c5, 0x00700000,
	0x00700081, 0x00600004, 0x0050004a, 0x00216f40, 0x00600007, 0x00c02801,
	0x0020002e, 0x00800001, 0x005000cb, 0x0090ffff, 0x0091ffff, 0x00200020,
	0x00600008, 0x0050004c, 0x00600009, 0x00413e45, 0x0041594d, 0x0070009d,
	0x00402dcf, 0x0070009f, 0x0050009f, 0x00402ac0, 0x00200200, 0x00600008,
	0x00402a4f, 0x00402ac0, 0x004030cc, 0x00700081, 0x00200000, 0x00600006,
	0x00700000, 0x00111bfc, 0x00700083, 0x00300000, 0x00216f40, 0x00600007,
	0x00c00b01, 0x0020001e, 0x00800001, 0x005000cb, 0x00c000ff, 0x00700080,
	0x00700083, 0x00200047, 0x00600006, 0x0011020a, 0x00200480, 0x00600007,
	0x00300000, 0x00c000ff, 0x00c800ff, 0x00414907, 0x00202916, 0x008000ff,
	0x0040508c, 0x005000cb, 0x00a0023f, 0x00200040, 0x00600006, 0x0070000f,
	0x00170202, 0x0011020a, 0x00200032, 0x0010020d, 0x001c0242, 0x00120302,
	0x00140402, 0x00180500, 0x00130509, 0x00150550, 0x00110605, 0x0020000f,
	0x00100607, 0x00110700, 0x00110900, 0x00120902, 0x00110a00, 0x00160b02,
	0x00120b28, 0x00140b2b, 0x00110c01, 0x00111400, 0x00111405, 0x00111407,
	0x00111409, 0x0011140b, 0x002000cb, 0x00101500, 0x0040790f, 0x0040794b,
	0x00214d40, 0x00600007, 0x0020043e, 0x008800ff, 0x0070008f, 0x0040798c,
	0x005000cb, 0x00000000, 0x0020002b, 0x00101a05, 0x00131c00, 0x00121c04,
	0x00141c20, 0x00111c25, 0x00131c40, 0x00121c44, 0x00141c60, 0x00111c65,
	0x00131c80, 0x00121c84, 0x00141ca0, 0x00111ca5, 0x00131cc0, 0x00121cc4,
	0x00141ce0, 0x00111ce5, 0x00131f00, 0x00191f40, 0x0040a1e0, 0x002001ed,
	0x00600006, 0x00200044, 0x00102080, 0x001120c6, 0x001520c9, 0x001920d0,
	0x00122100, 0x00122103, 0x00162200, 0x00122207, 0x00112280, 0x00112300,
	0x00112302, 0x00122380, 0x0011238b, 0x00112394, 0x0011239c, 0x0040bee1,
	0x00200254, 0x00600006, 0x00200044, 0x00102480, 0x0040af0f, 0x0040af4b,
	0x00214d40, 0x00600007, 0x0020043e, 0x008800ff, 0x0070008f, 0x0040af8c,
	0x005000cb, 0x00000000, 0x001124c6, 0x001524c9, 0x001924d0, 0x00122500,
	0x00122503, 0x00162600, 0x00122607, 0x00112680, 0x00112700, 0x00112702,
	0x00122780, 0x0011278b, 0x00112794, 0x0011279c, 0x0040d1e2, 0x002002bb,
	0x00600006, 0x00200044, 0x00102880, 0x001128c6, 0x001528c9, 0x001928d0,
	0x00122900, 0x00122903, 0x00162a00, 0x00122a07, 0x00112a80, 0x00112b00,
	0x00112b02, 0x00122b80, 0x00112b8b, 0x00112b94, 0x00112b9c, 0x0040eee3,
	0x00200322, 0x00600006, 0x00200044, 0x00102c80, 0x0040df0f, 0x0040df4b,
	0x00214d40, 0x00600007, 0x0020043e, 0x008800ff, 0x0070008f, 0x0040df8c,
	0x005000cb, 0x00000000, 0x00112cc6, 0x00152cc9, 0x00192cd0, 0x00122d00,
	0x00122d03, 0x00162e00, 0x00122e07, 0x00112e80, 0x00112f00, 0x00112f02,
	0x00122f80, 0x00112f8b, 0x00112f94, 0x00112f9c, 0x004101e4, 0x00200389,
	0x00600006, 0x00200044, 0x00103080, 0x001130c6, 0x001530c9, 0x001930d0,
	0x00123100, 0x00123103, 0x00163200, 0x00123207, 0x00113280, 0x00113300,
	0x00113302, 0x00123380, 0x0011338b, 0x00113394, 0x0011339c, 0x00411ee5,
	0x002003f0, 0x00600006, 0x00200044, 0x00103480, 0x00410f0f, 0x00410f4b,
	0x00214d40, 0x00600007, 0x0020043e, 0x008800ff, 0x0070008f, 0x00410f8c,
	0x005000cb, 0x00000000, 0x001134c6, 0x001534c9, 0x001934d0, 0x00123500,
	0x00123503, 0x00163600, 0x00123607, 0x00113680, 0x00113700, 0x00113702,
	0x00123780, 0x0011378b, 0x00113794, 0x0011379c, 0x00000000, 0x0041250f,
	0x005000cb, 0x00214d40, 0x00600007, 0x0020043e, 0x008800ff, 0x005000cb,
	0x00412887, 0x0060000a, 0x00000000, 0x00413700, 0x007000a0, 0x00700080,
	0x00200480, 0x00600007, 0x00200004, 0x00c000ff, 0x008000ff, 0x005000cb,
	0x00700000, 0x00200000, 0x00600006, 0x00111bfe, 0x0041594d, 0x00700000,
	0x00200000, 0x00600006, 0x00111bfe, 0x00700080, 0x0070001d, 0x0040114d,
	0x00700081, 0x00600004, 0x0050004a, 0x00414388, 0x0060000b, 0x00200000,
	0x00600006, 0x00700000, 0x0041590b, 0x00111bfd, 0x0040424d, 0x00202916,
	0x008000fd, 0x005000cb, 0x00c00002, 0x00200480, 0x00600007, 0x00200160,
	0x00800002, 0x005000cb, 0x00c01802, 0x002027b6, 0x00800002, 0x005000cb,
	0x00404e4d, 0x0060000b, 0x0041574d, 0x00700001, 0x005000cf, 0x00700003,
	0x00415e06, 0x00415f05, 0x0060000d, 0x00700005, 0x0070000d, 0x00700006,
	0x0070000b, 0x0070000e, 0x0070001c, 0x0060000c, ~0
};
 
static uint32_t nv86_ctx_voodoo[] = {
	0x0070008e, 0x0070009c, 0x00200020, 0x00600008, 0x0050004c, 0x00400e89,
	0x00200000, 0x00600007, 0x00300000, 0x00c000ff, 0x00200000, 0x008000ff,
	0x00700009, 0x0040dd4d, 0x00402944, 0x00402905, 0x0040290d, 0x0040b906,
	0x00600005, 0x004015c5, 0x00600011, 0x0040270b, 0x004021c5, 0x00700000,
	0x00700081, 0x00600004, 0x0050004a, 0x00216d80, 0x00600007, 0x00c02801,
	0x0020002e, 0x00800001, 0x005000cb, 0x0090ffff, 0x0091ffff, 0x00200020,
	0x00600008, 0x0050004c, 0x00600009, 0x0040b945, 0x0040d44d, 0x0070009d,
	0x00402dcf, 0x0070009f, 0x0050009f, 0x00402ac0, 0x00200200, 0x00600008,
	0x00402a4f, 0x00402ac0, 0x004030cc, 0x00700081, 0x00200000, 0x00600006,
	0x00700000, 0x00111bfc, 0x00700083, 0x00300000, 0x00216d80, 0x00600007,
	0x00c00b01, 0x0020001e, 0x00800001, 0x005000cb, 0x00c000ff, 0x00700080,
	0x00700083, 0x00200047, 0x00600006, 0x0011020a, 0x00200280, 0x00600007,
	0x00300000, 0x00c000ff, 0x00c800ff, 0x0040c407, 0x00202916, 0x008000ff,
	0x0040508c, 0x005000cb, 0x00a0023f, 0x00200040, 0x00600006, 0x0070000f,
	0x00170202, 0x0011020a, 0x00200032, 0x0010020d, 0x001c0242, 0x00120302,
	0x00140402, 0x00180500, 0x00130509, 0x00150550, 0x00110605, 0x0020000f,
	0x00100607, 0x00110700, 0x00110900, 0x00120902, 0x00110a00, 0x00160b02,
	0x00120b28, 0x00140b2b, 0x00110c01, 0x00111400, 0x00111405, 0x00111407,
	0x00111409, 0x0011140b, 0x002000cb, 0x00101500, 0x0040790f, 0x0040794b,
	0x00214b40, 0x00600007, 0x00200442, 0x008800ff, 0x0070008f, 0x0040798c,
	0x005000cb, 0x00000000, 0x0020002b, 0x00101a05, 0x00131c00, 0x00121c04,
	0x00141c20, 0x00111c25, 0x00131c40, 0x00121c44, 0x00141c60, 0x00111c65,
	0x00131f00, 0x00191f40, 0x004099e0, 0x002001d9, 0x00600006, 0x00200044,
	0x00102080, 0x001120c6, 0x001520c9, 0x001920d0, 0x00122100, 0x00122103,
	0x00162200, 0x00122207, 0x00112280, 0x00112300, 0x00112302, 0x00122380,
	0x0011238b, 0x00112394, 0x0011239c, 0x00000000, 0x0040a00f, 0x005000cb,
	0x00214b40, 0x00600007, 0x00200442, 0x008800ff, 0x005000cb, 0x0040a387,
	0x0060000a, 0x00000000, 0x0040b200, 0x007000a0, 0x00700080, 0x00200280,
	0x00600007, 0x00200004, 0x00c000ff, 0x008000ff, 0x005000cb, 0x00700000,
	0x00200000, 0x00600006, 0x00111bfe, 0x0040d44d, 0x00700000, 0x00200000,
	0x00600006, 0x00111bfe, 0x00700080, 0x0070001d, 0x0040114d, 0x00700081,
	0x00600004, 0x0050004a, 0x0040be88, 0x0060000b, 0x00200000, 0x00600006,
	0x00700000, 0x0040d40b, 0x00111bfd, 0x0040424d, 0x00202916, 0x008000fd,
	0x005000cb, 0x00c00002, 0x00200280, 0x00600007, 0x00200160, 0x00800002,
	0x005000cb, 0x00c01802, 0x002027b6, 0x00800002, 0x005000cb, 0x00404e4d,
	0x0060000b, 0x0040d24d, 0x00700001, 0x00700003, 0x0040d806, 0x0040d905,
	0x0060000d, 0x00700005, 0x0070000d, 0x00700006, 0x0070000b, 0x0070000e,
	0x0060000c, ~0
};

static int
nv50_graph_init_ctxctl(struct drm_device *dev)
{
	struct drm_nouveau_private *dev_priv = dev->dev_private;
	uint32_t *voodoo = NULL;

	DRM_DEBUG("\n");

	switch (dev_priv->chipset) {
	case 0x84:
		voodoo = nv84_ctx_voodoo;
		break;
	case 0x86:
		voodoo = nv86_ctx_voodoo;
		break;
	default:
		DRM_ERROR("no voodoo for chipset NV%02x\n", dev_priv->chipset);
		return -EINVAL;
	}

	NV_WRITE(NV40_PGRAPH_CTXCTL_UCODE_INDEX, 0);
	while (*voodoo != ~0) {
		NV_WRITE(NV40_PGRAPH_CTXCTL_UCODE_DATA, *voodoo);
		voodoo++;
	}

	NV_WRITE(0x400320, 4);
	NV_WRITE(NV40_PGRAPH_CTXCTL_CUR, 0);
	NV_WRITE(NV20_PGRAPH_CHANNEL_CTX_POINTER, 0);

	return 0;
}

int
nv50_graph_init(struct drm_device *dev)
{
	int ret;

	DRM_DEBUG("\n");

	nv50_graph_init_reset(dev);
	nv50_graph_init_intr(dev);
	nv50_graph_init_regs__nv(dev);
	nv50_graph_init_regs(dev);

	ret = nv50_graph_init_ctxctl(dev);
	if (ret)
		return ret;

	return 0;
}

void
nv50_graph_takedown(struct drm_device *dev)
{
	DRM_DEBUG("\n");
}

static void
nv86_graph_init_ctxvals(struct drm_device *dev, struct nouveau_gpuobj_ref *ref)
{
	struct drm_nouveau_private *dev_priv = dev->dev_private;
	struct nouveau_gpuobj *ctx = ref->gpuobj;

	INSTANCE_WR(ctx, 0x10C/4, 0x30);
	INSTANCE_WR(ctx, 0x1D4/4, 0x3);
	INSTANCE_WR(ctx, 0x1D8/4, 0x1000);
	INSTANCE_WR(ctx, 0x218/4, 0xFE0C);
	INSTANCE_WR(ctx, 0x22C/4, 0x1000);
	INSTANCE_WR(ctx, 0x258/4, 0x187);
	INSTANCE_WR(ctx, 0x26C/4, 0x1018);
	INSTANCE_WR(ctx, 0x270/4, 0xFF);
	INSTANCE_WR(ctx, 0x2AC/4, 0x4);
	INSTANCE_WR(ctx, 0x2B0/4, 0x44D00DF);
	INSTANCE_WR(ctx, 0x2B8/4, 0x600);
	INSTANCE_WR(ctx, 0x2D0/4, 0x1000000);
	INSTANCE_WR(ctx, 0x2D4/4, 0xFF);
	INSTANCE_WR(ctx, 0x2DC/4, 0x400);
	INSTANCE_WR(ctx, 0x2F4/4, 0x1);
	INSTANCE_WR(ctx, 0x2F8/4, 0x80);
	INSTANCE_WR(ctx, 0x2FC/4, 0x4);
	INSTANCE_WR(ctx, 0x318/4, 0x2);
	INSTANCE_WR(ctx, 0x31C/4, 0x1);
	INSTANCE_WR(ctx, 0x328/4, 0x1);
	INSTANCE_WR(ctx, 0x32C/4, 0x100);
	INSTANCE_WR(ctx, 0x344/4, 0x2);
	INSTANCE_WR(ctx, 0x348/4, 0x1);
	INSTANCE_WR(ctx, 0x34C/4, 0x1);
	INSTANCE_WR(ctx, 0x35C/4, 0x1);
	INSTANCE_WR(ctx, 0x360/4, 0x3FFFFF);
	INSTANCE_WR(ctx, 0x364/4, 0x1FFF);
	INSTANCE_WR(ctx, 0x36C/4, 0x1);
	INSTANCE_WR(ctx, 0x370/4, 0x1);
	INSTANCE_WR(ctx, 0x378/4, 0x1);
	INSTANCE_WR(ctx, 0x37C/4, 0x1);
	INSTANCE_WR(ctx, 0x380/4, 0x1);
	INSTANCE_WR(ctx, 0x384/4, 0x4);
	INSTANCE_WR(ctx, 0x388/4, 0x1);
	INSTANCE_WR(ctx, 0x38C/4, 0x1);
	INSTANCE_WR(ctx, 0x390/4, 0x1);
	INSTANCE_WR(ctx, 0x394/4, 0x7);
	INSTANCE_WR(ctx, 0x398/4, 0x1);
	INSTANCE_WR(ctx, 0x39C/4, 0x7);
	INSTANCE_WR(ctx, 0x3A0/4, 0x1);
	INSTANCE_WR(ctx, 0x3A4/4, 0x1);
	INSTANCE_WR(ctx, 0x3A8/4, 0x1);
	INSTANCE_WR(ctx, 0x3BC/4, 0x1);
	INSTANCE_WR(ctx, 0x3C0/4, 0x100);
	INSTANCE_WR(ctx, 0x3C8/4, 0x1);
	INSTANCE_WR(ctx, 0x3D4/4, 0x100);
	INSTANCE_WR(ctx, 0x3D8/4, 0x1);
	INSTANCE_WR(ctx, 0x3DC/4, 0x100);
	INSTANCE_WR(ctx, 0x3E4/4, 0x1);
	INSTANCE_WR(ctx, 0x3F0/4, 0x100);
	INSTANCE_WR(ctx, 0x404/4, 0x4);
	INSTANCE_WR(ctx, 0x408/4, 0x70);
	INSTANCE_WR(ctx, 0x40C/4, 0x80);
	INSTANCE_WR(ctx, 0x420/4, 0xC);
	INSTANCE_WR(ctx, 0x428/4, 0x8);
	INSTANCE_WR(ctx, 0x42C/4, 0x14);
	INSTANCE_WR(ctx, 0x434/4, 0x29);
	INSTANCE_WR(ctx, 0x438/4, 0x27);
	INSTANCE_WR(ctx, 0x43C/4, 0x26);
	INSTANCE_WR(ctx, 0x440/4, 0x8);
	INSTANCE_WR(ctx, 0x444/4, 0x4);
	INSTANCE_WR(ctx, 0x448/4, 0x27);
	INSTANCE_WR(ctx, 0x454/4, 0x1);
	INSTANCE_WR(ctx, 0x458/4, 0x2);
	INSTANCE_WR(ctx, 0x45C/4, 0x3);
	INSTANCE_WR(ctx, 0x460/4, 0x4);
	INSTANCE_WR(ctx, 0x464/4, 0x5);
	INSTANCE_WR(ctx, 0x468/4, 0x6);
	INSTANCE_WR(ctx, 0x46C/4, 0x7);
	INSTANCE_WR(ctx, 0x470/4, 0x1);
	INSTANCE_WR(ctx, 0x4B4/4, 0xCF);
	INSTANCE_WR(ctx, 0x4E4/4, 0x80);
	INSTANCE_WR(ctx, 0x4E8/4, 0x4);
	INSTANCE_WR(ctx, 0x4EC/4, 0x4);
	INSTANCE_WR(ctx, 0x4F0/4, 0x3);
	INSTANCE_WR(ctx, 0x4F4/4, 0x1);
	INSTANCE_WR(ctx, 0x500/4, 0x12);
	INSTANCE_WR(ctx, 0x504/4, 0x10);
	INSTANCE_WR(ctx, 0x508/4, 0xC);
	INSTANCE_WR(ctx, 0x50C/4, 0x1);
	INSTANCE_WR(ctx, 0x51C/4, 0x4);
	INSTANCE_WR(ctx, 0x520/4, 0x2);
	INSTANCE_WR(ctx, 0x524/4, 0x4);
	INSTANCE_WR(ctx, 0x530/4, 0x3FFFFF);
	INSTANCE_WR(ctx, 0x534/4, 0x1FFF);
	INSTANCE_WR(ctx, 0x55C/4, 0x4);
	INSTANCE_WR(ctx, 0x560/4, 0x14);
	INSTANCE_WR(ctx, 0x564/4, 0x1);
	INSTANCE_WR(ctx, 0x570/4, 0x2);
	INSTANCE_WR(ctx, 0x57C/4, 0x1);
	INSTANCE_WR(ctx, 0x584/4, 0x2);
	INSTANCE_WR(ctx, 0x588/4, 0x1000);
	INSTANCE_WR(ctx, 0x58C/4, 0xE00);
	INSTANCE_WR(ctx, 0x590/4, 0x1000);
	INSTANCE_WR(ctx, 0x594/4, 0x1E00);
	INSTANCE_WR(ctx, 0x59C/4, 0x1);
	INSTANCE_WR(ctx, 0x5A0/4, 0x1);
	INSTANCE_WR(ctx, 0x5A4/4, 0x1);
	INSTANCE_WR(ctx, 0x5A8/4, 0x1);
	INSTANCE_WR(ctx, 0x5AC/4, 0x1);
	INSTANCE_WR(ctx, 0x5BC/4, 0x200);
	INSTANCE_WR(ctx, 0x5C4/4, 0x1);
	INSTANCE_WR(ctx, 0x5C8/4, 0x70);
	INSTANCE_WR(ctx, 0x5CC/4, 0x80);
	INSTANCE_WR(ctx, 0x5D8/4, 0x1);
	INSTANCE_WR(ctx, 0x5DC/4, 0x70);
	INSTANCE_WR(ctx, 0x5E0/4, 0x80);
	INSTANCE_WR(ctx, 0x5F0/4, 0x1);
	INSTANCE_WR(ctx, 0x5F4/4, 0xCF);
	INSTANCE_WR(ctx, 0x5FC/4, 0x1);
	INSTANCE_WR(ctx, 0x60C/4, 0xCF);
	INSTANCE_WR(ctx, 0x614/4, 0x2);
	INSTANCE_WR(ctx, 0x61C/4, 0x1);
	INSTANCE_WR(ctx, 0x624/4, 0x1);
	INSTANCE_WR(ctx, 0x62C/4, 0xCF);
	INSTANCE_WR(ctx, 0x630/4, 0xCF);
	INSTANCE_WR(ctx, 0x634/4, 0x1);
	INSTANCE_WR(ctx, 0x63C/4, 0xF80);
	INSTANCE_WR(ctx, 0x684/4, 0x7F0080);
	INSTANCE_WR(ctx, 0x6C0/4, 0x7F0080);
	INSTANCE_WR(ctx, 0x6E4/4, 0x3B74F821);
	INSTANCE_WR(ctx, 0x6E8/4, 0x89058001);
	INSTANCE_WR(ctx, 0x6F0/4, 0x1000);
	INSTANCE_WR(ctx, 0x6F4/4, 0x1F);
	INSTANCE_WR(ctx, 0x6F8/4, 0x27C10FA);
	INSTANCE_WR(ctx, 0x6FC/4, 0x400000C0);
	INSTANCE_WR(ctx, 0x700/4, 0xB7892080);
	INSTANCE_WR(ctx, 0x70C/4, 0x3B74F821);
	INSTANCE_WR(ctx, 0x710/4, 0x89058001);
	INSTANCE_WR(ctx, 0x718/4, 0x1000);
	INSTANCE_WR(ctx, 0x71C/4, 0x1F);
	INSTANCE_WR(ctx, 0x720/4, 0x27C10FA);
	INSTANCE_WR(ctx, 0x724/4, 0x400000C0);
	INSTANCE_WR(ctx, 0x728/4, 0xB7892080);
	INSTANCE_WR(ctx, 0x734/4, 0x10040);
	INSTANCE_WR(ctx, 0x73C/4, 0x22);
	INSTANCE_WR(ctx, 0x748/4, 0x10040);
	INSTANCE_WR(ctx, 0x74C/4, 0x22);
	INSTANCE_WR(ctx, 0x764/4, 0x1800000);
	INSTANCE_WR(ctx, 0x768/4, 0x160000);
	INSTANCE_WR(ctx, 0x76C/4, 0x1800000);
	INSTANCE_WR(ctx, 0x77C/4, 0x3FFFF);
	INSTANCE_WR(ctx, 0x780/4, 0x8C0000);
	INSTANCE_WR(ctx, 0x7A4/4, 0x10401);
	INSTANCE_WR(ctx, 0x7AC/4, 0x78);
	INSTANCE_WR(ctx, 0x7B4/4, 0xBF);
	INSTANCE_WR(ctx, 0x7BC/4, 0x1210);
	INSTANCE_WR(ctx, 0x7C0/4, 0x8000080);
	INSTANCE_WR(ctx, 0x7E4/4, 0x1800000);
	INSTANCE_WR(ctx, 0x7E8/4, 0x160000);
	INSTANCE_WR(ctx, 0x7EC/4, 0x1800000);
	INSTANCE_WR(ctx, 0x7FC/4, 0x3FFFF);
	INSTANCE_WR(ctx, 0x800/4, 0x8C0000);
	INSTANCE_WR(ctx, 0x824/4, 0x10401);
	INSTANCE_WR(ctx, 0x82C/4, 0x78);
	INSTANCE_WR(ctx, 0x834/4, 0xBF);
	INSTANCE_WR(ctx, 0x83C/4, 0x1210);
	INSTANCE_WR(ctx, 0x840/4, 0x8000080);
	INSTANCE_WR(ctx, 0x868/4, 0x27070);
	INSTANCE_WR(ctx, 0x874/4, 0x3FFFFFF);
	INSTANCE_WR(ctx, 0x88C/4, 0x120407);
	INSTANCE_WR(ctx, 0x890/4, 0x5091507);
	INSTANCE_WR(ctx, 0x894/4, 0x5010202);
	INSTANCE_WR(ctx, 0x898/4, 0x30201);
	INSTANCE_WR(ctx, 0x8B4/4, 0x40);
	INSTANCE_WR(ctx, 0x8B8/4, 0xD0C0B0A);
	INSTANCE_WR(ctx, 0x8BC/4, 0x141210);
	INSTANCE_WR(ctx, 0x8C0/4, 0x1F0);
	INSTANCE_WR(ctx, 0x8C4/4, 0x1);
	INSTANCE_WR(ctx, 0x8C8/4, 0x3);
	INSTANCE_WR(ctx, 0x8D4/4, 0x39E00);
	INSTANCE_WR(ctx, 0x8D8/4, 0x100);
	INSTANCE_WR(ctx, 0x8DC/4, 0x3800);
	INSTANCE_WR(ctx, 0x8E0/4, 0x404040);
	INSTANCE_WR(ctx, 0x8E4/4, 0xFF0A);
	INSTANCE_WR(ctx, 0x8EC/4, 0x77F005);
	INSTANCE_WR(ctx, 0x8F0/4, 0x3F7FFF);
	INSTANCE_WR(ctx, 0x7BA0/4, 0x21);
	INSTANCE_WR(ctx, 0x7BC0/4, 0x1);
	INSTANCE_WR(ctx, 0x7BE0/4, 0x2);
	INSTANCE_WR(ctx, 0x7C00/4, 0x100);
	INSTANCE_WR(ctx, 0x7C20/4, 0x100);
	INSTANCE_WR(ctx, 0x7C40/4, 0x1);
	INSTANCE_WR(ctx, 0x7CA0/4, 0x1);
	INSTANCE_WR(ctx, 0x7CC0/4, 0x2);
	INSTANCE_WR(ctx, 0x7CE0/4, 0x100);
	INSTANCE_WR(ctx, 0x7D00/4, 0x100);
	INSTANCE_WR(ctx, 0x7D20/4, 0x1);
	INSTANCE_WR(ctx, 0x11640/4, 0x4);
	INSTANCE_WR(ctx, 0x11660/4, 0x4);
	INSTANCE_WR(ctx, 0x49FE0/4, 0x4);
	INSTANCE_WR(ctx, 0x4A000/4, 0x4);
	INSTANCE_WR(ctx, 0x4A020/4, 0x8100C12);
	INSTANCE_WR(ctx, 0x4A040/4, 0x3);
	INSTANCE_WR(ctx, 0x4A080/4, 0x8100C12);
	INSTANCE_WR(ctx, 0x4A0C0/4, 0x80C14);
	INSTANCE_WR(ctx, 0x4A0E0/4, 0x1);
	INSTANCE_WR(ctx, 0x4A100/4, 0x80C14);
	INSTANCE_WR(ctx, 0x4A160/4, 0x8100C12);
	INSTANCE_WR(ctx, 0x4A180/4, 0x27);
	INSTANCE_WR(ctx, 0x4A1E0/4, 0x1);
	INSTANCE_WR(ctx, 0x51A20/4, 0x1);
	INSTANCE_WR(ctx, 0x51D00/4, 0x8100C12);
	INSTANCE_WR(ctx, 0x51EA0/4, 0x4000000);
	INSTANCE_WR(ctx, 0x51EC0/4, 0x4000000);
	INSTANCE_WR(ctx, 0x51F00/4, 0x80);
	INSTANCE_WR(ctx, 0x51F80/4, 0x80);
	INSTANCE_WR(ctx, 0x51FC0/4, 0x3F);
	INSTANCE_WR(ctx, 0x52120/4, 0x2);
	INSTANCE_WR(ctx, 0x52140/4, 0x4000000);
	INSTANCE_WR(ctx, 0x52160/4, 0x4000000);
	INSTANCE_WR(ctx, 0x52280/4, 0x4);
	INSTANCE_WR(ctx, 0x52300/4, 0x4);
	INSTANCE_WR(ctx, 0x52540/4, 0x1);
	INSTANCE_WR(ctx, 0x52560/4, 0x1001);
	INSTANCE_WR(ctx, 0x52580/4, 0xFFFF);
	INSTANCE_WR(ctx, 0x525A0/4, 0xFFFF);
	INSTANCE_WR(ctx, 0x525C0/4, 0xFFFF);
	INSTANCE_WR(ctx, 0x525E0/4, 0xFFFF);
	INSTANCE_WR(ctx, 0x52A00/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x52A20/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x52A40/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x52A60/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x52A80/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x52AA0/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x52AC0/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x52AE0/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x52B00/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x52B20/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x52B40/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x52B60/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x52B80/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x52BA0/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x52BC0/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x52BE0/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x52C00/4, 0x10);
	INSTANCE_WR(ctx, 0x52C60/4, 0x3);
	INSTANCE_WR(ctx, 0xA84/4, 0xF);
	INSTANCE_WR(ctx, 0xB24/4, 0x20);
	INSTANCE_WR(ctx, 0xD04/4, 0x1A);
	INSTANCE_WR(ctx, 0xEC4/4, 0x4);
	INSTANCE_WR(ctx, 0xEE4/4, 0x4);
	INSTANCE_WR(ctx, 0xF24/4, 0x4);
	INSTANCE_WR(ctx, 0xF44/4, 0x8);
	INSTANCE_WR(ctx, 0xF84/4, 0x7FF);
	INSTANCE_WR(ctx, 0x1124/4, 0xF);
	INSTANCE_WR(ctx, 0x3604/4, 0xF);
	INSTANCE_WR(ctx, 0x3644/4, 0x1);
	INSTANCE_WR(ctx, 0x41A4/4, 0xF);
	INSTANCE_WR(ctx, 0x14844/4, 0xF);
	INSTANCE_WR(ctx, 0x14AE4/4, 0x1);
	INSTANCE_WR(ctx, 0x14B04/4, 0x100);
	INSTANCE_WR(ctx, 0x14B24/4, 0x100);
	INSTANCE_WR(ctx, 0x14B44/4, 0x11);
	INSTANCE_WR(ctx, 0x14B84/4, 0x8);
	INSTANCE_WR(ctx, 0x14C44/4, 0x1);
	INSTANCE_WR(ctx, 0x14C84/4, 0x1);
	INSTANCE_WR(ctx, 0x14CA4/4, 0x1);
	INSTANCE_WR(ctx, 0x14CC4/4, 0x1);
	INSTANCE_WR(ctx, 0x14CE4/4, 0xCF);
	INSTANCE_WR(ctx, 0x14D04/4, 0x2);
	INSTANCE_WR(ctx, 0x14DE4/4, 0x1);
	INSTANCE_WR(ctx, 0x14E24/4, 0x1);
	INSTANCE_WR(ctx, 0x14E44/4, 0x1);
	INSTANCE_WR(ctx, 0x14E64/4, 0x1);
	INSTANCE_WR(ctx, 0x14F04/4, 0x4);
	INSTANCE_WR(ctx, 0x14F44/4, 0x1);
	INSTANCE_WR(ctx, 0x14F64/4, 0x15);
	INSTANCE_WR(ctx, 0x14FE4/4, 0x4444480);
	INSTANCE_WR(ctx, 0x15764/4, 0x8100C12);
	INSTANCE_WR(ctx, 0x15804/4, 0x100);
	INSTANCE_WR(ctx, 0x15864/4, 0x10001);
	INSTANCE_WR(ctx, 0x158A4/4, 0x10001);
	INSTANCE_WR(ctx, 0x158C4/4, 0x1);
	INSTANCE_WR(ctx, 0x158E4/4, 0x10001);
	INSTANCE_WR(ctx, 0x15904/4, 0x1);
	INSTANCE_WR(ctx, 0x15924/4, 0x4);
	INSTANCE_WR(ctx, 0x15944/4, 0x2);
	INSTANCE_WR(ctx, 0x166C4/4, 0x4E3BFDF);
	INSTANCE_WR(ctx, 0x166E4/4, 0x4E3BFDF);
	INSTANCE_WR(ctx, 0x16784/4, 0xFAC6881);
	INSTANCE_WR(ctx, 0x16904/4, 0x4E3BFDF);
	INSTANCE_WR(ctx, 0x16924/4, 0x4E3BFDF);
	INSTANCE_WR(ctx, 0x15948/4, 0x3FFFFF);
	INSTANCE_WR(ctx, 0x159A8/4, 0x1FFF);
	INSTANCE_WR(ctx, 0x15B88/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x15C68/4, 0x4);
	INSTANCE_WR(ctx, 0x15C88/4, 0x1A);
	INSTANCE_WR(ctx, 0x15CE8/4, 0x1);
	INSTANCE_WR(ctx, 0x15F48/4, 0xFFFF00);
	INSTANCE_WR(ctx, 0x16028/4, 0xF);
	INSTANCE_WR(ctx, 0x16128/4, 0xFAC6881);
	INSTANCE_WR(ctx, 0x16148/4, 0x11);
	INSTANCE_WR(ctx, 0x16348/4, 0x4);
	INSTANCE_WR(ctx, 0x163E8/4, 0x2);
	INSTANCE_WR(ctx, 0x16408/4, 0x4000000);
	INSTANCE_WR(ctx, 0x16428/4, 0x4000000);
	INSTANCE_WR(ctx, 0x164A8/4, 0x5);
	INSTANCE_WR(ctx, 0x164C8/4, 0x52);
	INSTANCE_WR(ctx, 0x16568/4, 0x1);
	INSTANCE_WR(ctx, 0x16788/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x167A8/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x167C8/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x167E8/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x16808/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x16828/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x16848/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x16868/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x16888/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x168A8/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x168C8/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x168E8/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x16908/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x16928/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x16948/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x16968/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x16988/4, 0x10);
	INSTANCE_WR(ctx, 0x16E68/4, 0x8100C12);
	INSTANCE_WR(ctx, 0x16E88/4, 0x5);
	INSTANCE_WR(ctx, 0x16EE8/4, 0x1);
	INSTANCE_WR(ctx, 0x16F28/4, 0xFFFF);
	INSTANCE_WR(ctx, 0x16F48/4, 0xFFFF);
	INSTANCE_WR(ctx, 0x16F68/4, 0xFFFF);
	INSTANCE_WR(ctx, 0x16F88/4, 0xFFFF);
	INSTANCE_WR(ctx, 0x16FA8/4, 0x3);
	INSTANCE_WR(ctx, 0x173A8/4, 0xFFFF00);
	INSTANCE_WR(ctx, 0x173C8/4, 0x1A);
	INSTANCE_WR(ctx, 0x17408/4, 0x3);
	INSTANCE_WR(ctx, 0x178E8/4, 0x102);
	INSTANCE_WR(ctx, 0x17928/4, 0x4);
	INSTANCE_WR(ctx, 0x17948/4, 0x4);
	INSTANCE_WR(ctx, 0x17968/4, 0x4);
	INSTANCE_WR(ctx, 0x17988/4, 0x4);
	INSTANCE_WR(ctx, 0x179A8/4, 0x4);
	INSTANCE_WR(ctx, 0x179C8/4, 0x4);
	INSTANCE_WR(ctx, 0x17A08/4, 0x7FF);
	INSTANCE_WR(ctx, 0x17A48/4, 0x102);
	INSTANCE_WR(ctx, 0x17B88/4, 0x4);
	INSTANCE_WR(ctx, 0x17BA8/4, 0x4);
	INSTANCE_WR(ctx, 0x17BC8/4, 0x4);
	INSTANCE_WR(ctx, 0x17BE8/4, 0x4);
	INSTANCE_WR(ctx, 0x18228/4, 0x80C14);
	INSTANCE_WR(ctx, 0x18288/4, 0x804);
	INSTANCE_WR(ctx, 0x182C8/4, 0x4);
	INSTANCE_WR(ctx, 0x182E8/4, 0x4);
	INSTANCE_WR(ctx, 0x18308/4, 0x8100C12);
	INSTANCE_WR(ctx, 0x18348/4, 0x4);
	INSTANCE_WR(ctx, 0x18368/4, 0x4);
	INSTANCE_WR(ctx, 0x183A8/4, 0x10);
	INSTANCE_WR(ctx, 0x18448/4, 0x804);
	INSTANCE_WR(ctx, 0x18468/4, 0x1);
	INSTANCE_WR(ctx, 0x18488/4, 0x1A);
	INSTANCE_WR(ctx, 0x184A8/4, 0x7F);
	INSTANCE_WR(ctx, 0x184E8/4, 0x1);
	INSTANCE_WR(ctx, 0x18508/4, 0x80C14);
	INSTANCE_WR(ctx, 0x18548/4, 0x8100C12);
	INSTANCE_WR(ctx, 0x18568/4, 0x4);
	INSTANCE_WR(ctx, 0x18588/4, 0x4);
	INSTANCE_WR(ctx, 0x185C8/4, 0x10);
	INSTANCE_WR(ctx, 0x18648/4, 0x1);
	INSTANCE_WR(ctx, 0x18668/4, 0x8100C12);
	INSTANCE_WR(ctx, 0x18748/4, 0x7FF);
	INSTANCE_WR(ctx, 0x18768/4, 0x80C14);
	INSTANCE_WR(ctx, 0x18E88/4, 0x1);
	INSTANCE_WR(ctx, 0x18EE8/4, 0x10);
	INSTANCE_WR(ctx, 0x19608/4, 0x88);
	INSTANCE_WR(ctx, 0x19628/4, 0x88);
	INSTANCE_WR(ctx, 0x19688/4, 0x4);
	INSTANCE_WR(ctx, 0x19968/4, 0x26);
	INSTANCE_WR(ctx, 0x199C8/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x19A48/4, 0x1A);
	INSTANCE_WR(ctx, 0x19A68/4, 0x10);
	INSTANCE_WR(ctx, 0x19F88/4, 0x52);
	INSTANCE_WR(ctx, 0x19FC8/4, 0x26);
	INSTANCE_WR(ctx, 0x1A008/4, 0x4);
	INSTANCE_WR(ctx, 0x1A028/4, 0x4);
	INSTANCE_WR(ctx, 0x1A068/4, 0x1A);
	INSTANCE_WR(ctx, 0x1A0C8/4, 0xFFFF00);
	INSTANCE_WR(ctx, 0x1A108/4, 0x4);
	INSTANCE_WR(ctx, 0x1A128/4, 0x4);
	INSTANCE_WR(ctx, 0x1A168/4, 0x80);
	INSTANCE_WR(ctx, 0x1A188/4, 0x4);
	INSTANCE_WR(ctx, 0x1A1A8/4, 0x80C14);
	INSTANCE_WR(ctx, 0x1A1E8/4, 0x7FF);
	INSTANCE_WR(ctx, 0x24A48/4, 0x4);
	INSTANCE_WR(ctx, 0x24A68/4, 0x4);
	INSTANCE_WR(ctx, 0x24AA8/4, 0x80);
	INSTANCE_WR(ctx, 0x24AC8/4, 0x4);
	INSTANCE_WR(ctx, 0x24AE8/4, 0x1);
	INSTANCE_WR(ctx, 0x24B28/4, 0x27);
	INSTANCE_WR(ctx, 0x24B68/4, 0x26);
	INSTANCE_WR(ctx, 0x24BE8/4, 0x4000000);
	INSTANCE_WR(ctx, 0x24C08/4, 0x4000000);
	INSTANCE_WR(ctx, 0x24C28/4, 0x4000000);
	INSTANCE_WR(ctx, 0x24C48/4, 0x4000000);
	INSTANCE_WR(ctx, 0x24C68/4, 0x4000000);
	INSTANCE_WR(ctx, 0x24C88/4, 0x4000000);
	INSTANCE_WR(ctx, 0x24CA8/4, 0x4000000);
	INSTANCE_WR(ctx, 0x24CC8/4, 0x4000000);
	INSTANCE_WR(ctx, 0x24CE8/4, 0x4000000);
	INSTANCE_WR(ctx, 0x24D08/4, 0x4000000);
	INSTANCE_WR(ctx, 0x24D28/4, 0x4000000);
	INSTANCE_WR(ctx, 0x24D48/4, 0x4000000);
	INSTANCE_WR(ctx, 0x24D68/4, 0x4000000);
	INSTANCE_WR(ctx, 0x24D88/4, 0x4000000);
	INSTANCE_WR(ctx, 0x24DA8/4, 0x4000000);
	INSTANCE_WR(ctx, 0x24DC8/4, 0x4000000);
	INSTANCE_WR(ctx, 0x25268/4, 0x4E3BFDF);
	INSTANCE_WR(ctx, 0x25288/4, 0x4E3BFDF);
	INSTANCE_WR(ctx, 0x252E8/4, 0x1FE21);
	INSTANCE_WR(ctx, 0xB0C/4, 0x2);
	INSTANCE_WR(ctx, 0xB4C/4, 0x1FFE67);
	INSTANCE_WR(ctx, 0xCEC/4, 0x1);
	INSTANCE_WR(ctx, 0xD0C/4, 0x10);
	INSTANCE_WR(ctx, 0xD6C/4, 0x1);
	INSTANCE_WR(ctx, 0xE0C/4, 0x4);
	INSTANCE_WR(ctx, 0xE2C/4, 0x400);
	INSTANCE_WR(ctx, 0xE4C/4, 0x300);
	INSTANCE_WR(ctx, 0xE6C/4, 0x1001);
	INSTANCE_WR(ctx, 0xE8C/4, 0x15);
	INSTANCE_WR(ctx, 0xF4C/4, 0x2);
	INSTANCE_WR(ctx, 0x106C/4, 0x1);
	INSTANCE_WR(ctx, 0x108C/4, 0x10);
	INSTANCE_WR(ctx, 0x10CC/4, 0x1);
	INSTANCE_WR(ctx, 0x134C/4, 0x10);
	INSTANCE_WR(ctx, 0x156C/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x158C/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x15AC/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x15CC/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x15EC/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x160C/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x162C/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x164C/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x166C/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x168C/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x16AC/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x16CC/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x16EC/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x170C/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x172C/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x174C/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x1A8C/4, 0x10);
	INSTANCE_WR(ctx, 0x1ACC/4, 0x3F);
	INSTANCE_WR(ctx, 0x1BAC/4, 0x1);
	INSTANCE_WR(ctx, 0x1BEC/4, 0x1);
	INSTANCE_WR(ctx, 0x1C2C/4, 0x1);
	INSTANCE_WR(ctx, 0x1DCC/4, 0x11);
	INSTANCE_WR(ctx, 0x1ECC/4, 0xF);
	INSTANCE_WR(ctx, 0x1FCC/4, 0x11);
	INSTANCE_WR(ctx, 0x20AC/4, 0x1);
	INSTANCE_WR(ctx, 0x20CC/4, 0x1);
	INSTANCE_WR(ctx, 0x20EC/4, 0x1);
	INSTANCE_WR(ctx, 0x210C/4, 0x2);
	INSTANCE_WR(ctx, 0x212C/4, 0x1);
	INSTANCE_WR(ctx, 0x214C/4, 0x2);
	INSTANCE_WR(ctx, 0x216C/4, 0x1);
	INSTANCE_WR(ctx, 0x21AC/4, 0x1FFE67);
	INSTANCE_WR(ctx, 0x21EC/4, 0xFAC6881);
	INSTANCE_WR(ctx, 0x24AC/4, 0x1);
	INSTANCE_WR(ctx, 0x24CC/4, 0x2);
	INSTANCE_WR(ctx, 0x24EC/4, 0x1);
	INSTANCE_WR(ctx, 0x250C/4, 0x1);
	INSTANCE_WR(ctx, 0x252C/4, 0x2);
	INSTANCE_WR(ctx, 0x254C/4, 0x1);
	INSTANCE_WR(ctx, 0x256C/4, 0x1);
	INSTANCE_WR(ctx, 0x25EC/4, 0x11);
	INSTANCE_WR(ctx, 0x260C/4, 0x1);
	INSTANCE_WR(ctx, 0x328C/4, 0x2);
	INSTANCE_WR(ctx, 0x32CC/4, 0x1FFE67);
	INSTANCE_WR(ctx, 0x346C/4, 0x1);
	INSTANCE_WR(ctx, 0x348C/4, 0x10);
	INSTANCE_WR(ctx, 0x34EC/4, 0x1);
	INSTANCE_WR(ctx, 0x358C/4, 0x4);
	INSTANCE_WR(ctx, 0x35AC/4, 0x400);
	INSTANCE_WR(ctx, 0x35CC/4, 0x300);
	INSTANCE_WR(ctx, 0x35EC/4, 0x1001);
	INSTANCE_WR(ctx, 0x360C/4, 0x15);
	INSTANCE_WR(ctx, 0x36CC/4, 0x2);
	INSTANCE_WR(ctx, 0x37EC/4, 0x1);
	INSTANCE_WR(ctx, 0x380C/4, 0x10);
	INSTANCE_WR(ctx, 0x384C/4, 0x1);
	INSTANCE_WR(ctx, 0x3ACC/4, 0x10);
	INSTANCE_WR(ctx, 0x3CEC/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x3D0C/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x3D2C/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x3D4C/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x3D6C/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x3D8C/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x3DAC/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x3DCC/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x3DEC/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x3E0C/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x3E2C/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x3E4C/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x3E6C/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x3E8C/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x3EAC/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x3ECC/4, 0x3F800000);
	INSTANCE_WR(ctx, 0x420C/4, 0x10);
	INSTANCE_WR(ctx, 0x424C/4, 0x3F);
	INSTANCE_WR(ctx, 0x432C/4, 0x1);
	INSTANCE_WR(ctx, 0x436C/4, 0x1);
	INSTANCE_WR(ctx, 0x43AC/4, 0x1);
	INSTANCE_WR(ctx, 0x454C/4, 0x11);
	INSTANCE_WR(ctx, 0x464C/4, 0xF);
	INSTANCE_WR(ctx, 0x474C/4, 0x11);
	INSTANCE_WR(ctx, 0x482C/4, 0x1);
	INSTANCE_WR(ctx, 0x484C/4, 0x1);
	INSTANCE_WR(ctx, 0x486C/4, 0x1);
	INSTANCE_WR(ctx, 0x488C/4, 0x2);
	INSTANCE_WR(ctx, 0x48AC/4, 0x1);
	INSTANCE_WR(ctx, 0x48CC/4, 0x2);
	INSTANCE_WR(ctx, 0x48EC/4, 0x1);
	INSTANCE_WR(ctx, 0x492C/4, 0x1FFE67);
	INSTANCE_WR(ctx, 0x496C/4, 0xFAC6881);
	INSTANCE_WR(ctx, 0x4C2C/4, 0x1);
	INSTANCE_WR(ctx, 0x4C4C/4, 0x2);
	INSTANCE_WR(ctx, 0x4C6C/4, 0x1);
	INSTANCE_WR(ctx, 0x4C8C/4, 0x1);
	INSTANCE_WR(ctx, 0x4CAC/4, 0x2);
	INSTANCE_WR(ctx, 0x4CCC/4, 0x1);
	INSTANCE_WR(ctx, 0x4CEC/4, 0x1);
	INSTANCE_WR(ctx, 0x4D6C/4, 0x11);
	INSTANCE_WR(ctx, 0x4D8C/4, 0x1);
	INSTANCE_WR(ctx, 0xA30/4, 0x4);
	INSTANCE_WR(ctx, 0xCF0/4, 0x4);
	INSTANCE_WR(ctx, 0xD10/4, 0x4);
	INSTANCE_WR(ctx, 0xD30/4, 0x608080);
	INSTANCE_WR(ctx, 0xDD0/4, 0x4);
	INSTANCE_WR(ctx, 0xE30/4, 0x4);
	INSTANCE_WR(ctx, 0xE50/4, 0x4);
	INSTANCE_WR(ctx, 0xE70/4, 0x80);
	INSTANCE_WR(ctx, 0xE90/4, 0x1E00);
	INSTANCE_WR(ctx, 0xEB0/4, 0x4);
	INSTANCE_WR(ctx, 0x1350/4, 0x4);
	INSTANCE_WR(ctx, 0x1370/4, 0x80);
	INSTANCE_WR(ctx, 0x1390/4, 0x4);
	INSTANCE_WR(ctx, 0x13B0/4, 0x3020100);
	INSTANCE_WR(ctx, 0x13D0/4, 0x3);
	INSTANCE_WR(ctx, 0x13F0/4, 0x1E00);
	INSTANCE_WR(ctx, 0x1410/4, 0x4);
	INSTANCE_WR(ctx, 0x14B0/4, 0x4);
	INSTANCE_WR(ctx, 0x14D0/4, 0x3);
	INSTANCE_WR(ctx, 0x1550/4, 0x4);
	INSTANCE_WR(ctx, 0x159F0/4, 0x4);
	INSTANCE_WR(ctx, 0x15A10/4, 0x3);
	INSTANCE_WR(ctx, 0x15C50/4, 0xF);
	INSTANCE_WR(ctx, 0x15DD0/4, 0x4);
	INSTANCE_WR(ctx, 0x15DF0/4, 0xFFFF);
	INSTANCE_WR(ctx, 0x15E10/4, 0xFFFF);
	INSTANCE_WR(ctx, 0x15E30/4, 0xFFFF);
	INSTANCE_WR(ctx, 0x15E50/4, 0xFFFF);
	INSTANCE_WR(ctx, 0x15F70/4, 0x1);
	INSTANCE_WR(ctx, 0x15FF0/4, 0x1);
	INSTANCE_WR(ctx, 0x160B0/4, 0x1);
	INSTANCE_WR(ctx, 0x16250/4, 0x1);
	INSTANCE_WR(ctx, 0x16270/4, 0x1);
	INSTANCE_WR(ctx, 0x16290/4, 0x2);
	INSTANCE_WR(ctx, 0x162B0/4, 0x1);
	INSTANCE_WR(ctx, 0x162D0/4, 0x1);
	INSTANCE_WR(ctx, 0x162F0/4, 0x2);
	INSTANCE_WR(ctx, 0x16310/4, 0x1);
	INSTANCE_WR(ctx, 0x16350/4, 0x11);
	INSTANCE_WR(ctx, 0x16450/4, 0xFAC6881);
	INSTANCE_WR(ctx, 0x164B0/4, 0x4);
	INSTANCE_WR(ctx, 0x16530/4, 0x11);
	INSTANCE_WR(ctx, 0x16550/4, 0x1);
	INSTANCE_WR(ctx, 0x16590/4, 0xCF);
	INSTANCE_WR(ctx, 0x165B0/4, 0xCF);
	INSTANCE_WR(ctx, 0x165D0/4, 0xCF);
	INSTANCE_WR(ctx, 0x16730/4, 0x1);
	INSTANCE_WR(ctx, 0x16750/4, 0x1);
	INSTANCE_WR(ctx, 0x16770/4, 0x2);
	INSTANCE_WR(ctx, 0x16790/4, 0x1);
	INSTANCE_WR(ctx, 0x167B0/4, 0x1);
	INSTANCE_WR(ctx, 0x167D0/4, 0x2);
	INSTANCE_WR(ctx, 0x167F0/4, 0x1);
	INSTANCE_WR(ctx, 0x16830/4, 0x1);
	INSTANCE_WR(ctx, 0x16850/4, 0x1);
	INSTANCE_WR(ctx, 0x16870/4, 0x1);
	INSTANCE_WR(ctx, 0x16890/4, 0x1);
	INSTANCE_WR(ctx, 0x168B0/4, 0x1);
	INSTANCE_WR(ctx, 0x168D0/4, 0x1);
	INSTANCE_WR(ctx, 0x168F0/4, 0x1);
	INSTANCE_WR(ctx, 0x16910/4, 0x1);
	INSTANCE_WR(ctx, 0x16930/4, 0x11);
	INSTANCE_WR(ctx, 0x16A30/4, 0xFAC6881);
	INSTANCE_WR(ctx, 0x16A50/4, 0xF);
	INSTANCE_WR(ctx, 0x16B50/4, 0x1FFE67);
	INSTANCE_WR(ctx, 0x16BB0/4, 0x11);
	INSTANCE_WR(ctx, 0x16BD0/4, 0x1);
	INSTANCE_WR(ctx, 0x16C50/4, 0x4);
	INSTANCE_WR(ctx, 0x16D10/4, 0x1);
	INSTANCE_WR(ctx, 0x16DB0/4, 0x11);
	INSTANCE_WR(ctx, 0x16EB0/4, 0xFAC6881);
	INSTANCE_WR(ctx, 0x16F30/4, 0x11);
	INSTANCE_WR(ctx, 0x16F50/4, 0x1);
	INSTANCE_WR(ctx, 0x16F90/4, 0x1);
	INSTANCE_WR(ctx, 0x16FD0/4, 0x1);
	INSTANCE_WR(ctx, 0x17010/4, 0x7FF);
	INSTANCE_WR(ctx, 0x17050/4, 0x1);
	INSTANCE_WR(ctx, 0x17090/4, 0x1);
	INSTANCE_WR(ctx, 0x175F0/4, 0x8);
	INSTANCE_WR(ctx, 0x17610/4, 0x8);
	INSTANCE_WR(ctx, 0x17630/4, 0x8);
	INSTANCE_WR(ctx, 0x17650/4, 0x8);
	INSTANCE_WR(ctx, 0x17670/4, 0x8);
	INSTANCE_WR(ctx, 0x17690/4, 0x8);
	INSTANCE_WR(ctx, 0x176B0/4, 0x8);
	INSTANCE_WR(ctx, 0x176D0/4, 0x8);
	INSTANCE_WR(ctx, 0x176F0/4, 0x11);
	INSTANCE_WR(ctx, 0x177F0/4, 0xFAC6881);
	INSTANCE_WR(ctx, 0x17810/4, 0x400);
	INSTANCE_WR(ctx, 0x17830/4, 0x400);
	INSTANCE_WR(ctx, 0x17850/4, 0x400);
	INSTANCE_WR(ctx, 0x17870/4, 0x400);
	INSTANCE_WR(ctx, 0x17890/4, 0x400);
	INSTANCE_WR(ctx, 0x178B0/4, 0x400);
	INSTANCE_WR(ctx, 0x178D0/4, 0x400);
	INSTANCE_WR(ctx, 0x178F0/4, 0x400);
	INSTANCE_WR(ctx, 0x17910/4, 0x300);
	INSTANCE_WR(ctx, 0x17930/4, 0x300);
	INSTANCE_WR(ctx, 0x17950/4, 0x300);
	INSTANCE_WR(ctx, 0x17970/4, 0x300);
	INSTANCE_WR(ctx, 0x17990/4, 0x300);
	INSTANCE_WR(ctx, 0x179B0/4, 0x300);
	INSTANCE_WR(ctx, 0x179D0/4, 0x300);
	INSTANCE_WR(ctx, 0x179F0/4, 0x300);
	INSTANCE_WR(ctx, 0x17A10/4, 0x1);
	INSTANCE_WR(ctx, 0x17A30/4, 0xF);
	INSTANCE_WR(ctx, 0x17B30/4, 0x20);
	INSTANCE_WR(ctx, 0x17B50/4, 0x11);
	INSTANCE_WR(ctx, 0x17B70/4, 0x100);
	INSTANCE_WR(ctx, 0x17BB0/4, 0x1);
	INSTANCE_WR(ctx, 0x17C10/4, 0x40);
	INSTANCE_WR(ctx, 0x17C30/4, 0x100);
	INSTANCE_WR(ctx, 0x17C70/4, 0x3);
	INSTANCE_WR(ctx, 0x17D10/4, 0x1FFE67);
	INSTANCE_WR(ctx, 0x17D90/4, 0x2);
	INSTANCE_WR(ctx, 0x17DB0/4, 0xFAC6881);
	INSTANCE_WR(ctx, 0x17EF0/4, 0x1);
	INSTANCE_WR(ctx, 0x17F90/4, 0x4);
	INSTANCE_WR(ctx, 0x17FD0/4, 0x1);
	INSTANCE_WR(ctx, 0x17FF0/4, 0x400);
	INSTANCE_WR(ctx, 0x18010/4, 0x300);
	INSTANCE_WR(ctx, 0x18030/4, 0x1001);
	INSTANCE_WR(ctx, 0x180B0/4, 0x11);
	INSTANCE_WR(ctx, 0x181B0/4, 0xFAC6881);
	INSTANCE_WR(ctx, 0x181D0/4, 0xF);
	INSTANCE_WR(ctx, 0x184D0/4, 0x1FFE67);
	INSTANCE_WR(ctx, 0x18550/4, 0x11);
	INSTANCE_WR(ctx, 0x185B0/4, 0x4);
	INSTANCE_WR(ctx, 0x185F0/4, 0x1);
	INSTANCE_WR(ctx, 0x18610/4, 0x1);
	INSTANCE_WR(ctx, 0x18690/4, 0x1);
	INSTANCE_WR(ctx, 0x18730/4, 0x1);
	INSTANCE_WR(ctx, 0x18770/4, 0x1);
	INSTANCE_WR(ctx, 0x187F0/4, 0x2A712488);
	INSTANCE_WR(ctx, 0x18830/4, 0x4085C000);
	INSTANCE_WR(ctx, 0x18850/4, 0x40);
	INSTANCE_WR(ctx, 0x18870/4, 0x100);
	INSTANCE_WR(ctx, 0x18890/4, 0x10100);
	INSTANCE_WR(ctx, 0x188B0/4, 0x2800000);
	INSTANCE_WR(ctx, 0x18B10/4, 0x4E3BFDF);
	INSTANCE_WR(ctx, 0x18B30/4, 0x4E3BFDF);
	INSTANCE_WR(ctx, 0x18B50/4, 0x1);
	INSTANCE_WR(ctx, 0x18B90/4, 0xFFFF00);
	INSTANCE_WR(ctx, 0x18BB0/4, 0x1);
	INSTANCE_WR(ctx, 0x18C10/4, 0xFFFF00);
	INSTANCE_WR(ctx, 0x18D30/4, 0x1);
	INSTANCE_WR(ctx, 0x18D70/4, 0x1);
	INSTANCE_WR(ctx, 0x18D90/4, 0x30201000);
	INSTANCE_WR(ctx, 0x18DB0/4, 0x70605040);
	INSTANCE_WR(ctx, 0x18DD0/4, 0xB8A89888);
	INSTANCE_WR(ctx, 0x18DF0/4, 0xF8E8D8C8);
	INSTANCE_WR(ctx, 0x18E30/4, 0x1A);
}


static void
nv84_graph_init_ctxvals(struct drm_device *dev, struct nouveau_gpuobj_ref *ref)
{
	struct drm_nouveau_private *dev_priv = dev->dev_private;
	struct nouveau_gpuobj *ctx = ref->gpuobj;

	INSTANCE_WR(ctx, 0x0010c/4, 0x00000030);
	INSTANCE_WR(ctx, 0x00130/4, 0x00000002);
	INSTANCE_WR(ctx, 0x001d4/4, 0x00000003);
	INSTANCE_WR(ctx, 0x001d8/4, 0x00001000);
	INSTANCE_WR(ctx, 0x00218/4, 0x0000fe0c);
	INSTANCE_WR(ctx, 0x0022c/4, 0x00001000);
	INSTANCE_WR(ctx, 0x00258/4, 0x00000187);
	INSTANCE_WR(ctx, 0x0026c/4, 0x00001018);
	INSTANCE_WR(ctx, 0x00270/4, 0x000000ff);
	INSTANCE_WR(ctx, 0x002ac/4, 0x00000004);
	INSTANCE_WR(ctx, 0x002b0/4, 0x044d00df);
	INSTANCE_WR(ctx, 0x002b8/4, 0x00000600);
	INSTANCE_WR(ctx, 0x002d0/4, 0x01000000);
	INSTANCE_WR(ctx, 0x002d4/4, 0x000000ff);
	INSTANCE_WR(ctx, 0x002dc/4, 0x00000400);
	INSTANCE_WR(ctx, 0x002f4/4, 0x00000001);
	INSTANCE_WR(ctx, 0x002f8/4, 0x000e0080);
	INSTANCE_WR(ctx, 0x002fc/4, 0x00000004);
	INSTANCE_WR(ctx, 0x00318/4, 0x00000002);
	INSTANCE_WR(ctx, 0x0031c/4, 0x00000001);
	INSTANCE_WR(ctx, 0x00328/4, 0x00000001);
	INSTANCE_WR(ctx, 0x0032c/4, 0x00000100);
	INSTANCE_WR(ctx, 0x00344/4, 0x00000002);
	INSTANCE_WR(ctx, 0x00348/4, 0x00000001);
	INSTANCE_WR(ctx, 0x0034c/4, 0x00000001);
	INSTANCE_WR(ctx, 0x0035c/4, 0x00000001);
	INSTANCE_WR(ctx, 0x00360/4, 0x003fffff);
	INSTANCE_WR(ctx, 0x00364/4, 0x00001fff);
	INSTANCE_WR(ctx, 0x0036c/4, 0x00000001);
	INSTANCE_WR(ctx, 0x00370/4, 0x00000001);
	INSTANCE_WR(ctx, 0x00378/4, 0x00000001);
	INSTANCE_WR(ctx, 0x0037c/4, 0x00000001);
	INSTANCE_WR(ctx, 0x00380/4, 0x00000001);
	INSTANCE_WR(ctx, 0x00384/4, 0x00000004);
	INSTANCE_WR(ctx, 0x00388/4, 0x00000001);
	INSTANCE_WR(ctx, 0x0038c/4, 0x00000001);
	INSTANCE_WR(ctx, 0x00390/4, 0x00000001);
	INSTANCE_WR(ctx, 0x00394/4, 0x00000007);
	INSTANCE_WR(ctx, 0x00398/4, 0x00000001);
	INSTANCE_WR(ctx, 0x0039c/4, 0x00000007);
	INSTANCE_WR(ctx, 0x003a0/4, 0x00000001);
	INSTANCE_WR(ctx, 0x003a4/4, 0x00000001);
	INSTANCE_WR(ctx, 0x003a8/4, 0x00000001);
	INSTANCE_WR(ctx, 0x003bc/4, 0x00000001);
	INSTANCE_WR(ctx, 0x003c0/4, 0x00000100);
	INSTANCE_WR(ctx, 0x003c8/4, 0x00000001);
	INSTANCE_WR(ctx, 0x003d4/4, 0x00000100);
	INSTANCE_WR(ctx, 0x003d8/4, 0x00000001);
	INSTANCE_WR(ctx, 0x003dc/4, 0x00000100);
	INSTANCE_WR(ctx, 0x003e4/4, 0x00000001);
	INSTANCE_WR(ctx, 0x003f0/4, 0x00000100);
	INSTANCE_WR(ctx, 0x00404/4, 0x00000004);
	INSTANCE_WR(ctx, 0x00408/4, 0x00000070);
	INSTANCE_WR(ctx, 0x0040c/4, 0x00000080);
	INSTANCE_WR(ctx, 0x00420/4, 0x0000000c);
	INSTANCE_WR(ctx, 0x00428/4, 0x00000008);
	INSTANCE_WR(ctx, 0x0042c/4, 0x00000014);
	INSTANCE_WR(ctx, 0x00434/4, 0x00000029);
	INSTANCE_WR(ctx, 0x00438/4, 0x00000027);
	INSTANCE_WR(ctx, 0x0043c/4, 0x00000026);
	INSTANCE_WR(ctx, 0x00440/4, 0x00000008);
	INSTANCE_WR(ctx, 0x00444/4, 0x00000004);
	INSTANCE_WR(ctx, 0x00448/4, 0x00000027);
	INSTANCE_WR(ctx, 0x00454/4, 0x00000001);
	INSTANCE_WR(ctx, 0x00458/4, 0x00000002);
	INSTANCE_WR(ctx, 0x0045c/4, 0x00000003);
	INSTANCE_WR(ctx, 0x00460/4, 0x00000004);
	INSTANCE_WR(ctx, 0x00464/4, 0x00000005);
	INSTANCE_WR(ctx, 0x00468/4, 0x00000006);
	INSTANCE_WR(ctx, 0x0046c/4, 0x00000007);
	INSTANCE_WR(ctx, 0x00470/4, 0x00000001);
	INSTANCE_WR(ctx, 0x004b4/4, 0x000000cf);
	INSTANCE_WR(ctx, 0x004e4/4, 0x00000080);
	INSTANCE_WR(ctx, 0x004e8/4, 0x00000004);
	INSTANCE_WR(ctx, 0x004ec/4, 0x00000004);
	INSTANCE_WR(ctx, 0x004f0/4, 0x00000003);
	INSTANCE_WR(ctx, 0x004f4/4, 0x00000001);
	INSTANCE_WR(ctx, 0x00500/4, 0x00000012);
	INSTANCE_WR(ctx, 0x00504/4, 0x00000010);
	INSTANCE_WR(ctx, 0x00508/4, 0x0000000c);
	INSTANCE_WR(ctx, 0x0050c/4, 0x00000001);
	INSTANCE_WR(ctx, 0x0051c/4, 0x00000004);
	INSTANCE_WR(ctx, 0x00520/4, 0x00000002);
	INSTANCE_WR(ctx, 0x00524/4, 0x00000004);
	INSTANCE_WR(ctx, 0x00530/4, 0x003fffff);
	INSTANCE_WR(ctx, 0x00534/4, 0x00001fff);
	INSTANCE_WR(ctx, 0x0055c/4, 0x00000004);
	INSTANCE_WR(ctx, 0x00560/4, 0x00000014);
	INSTANCE_WR(ctx, 0x00564/4, 0x00000001);
	INSTANCE_WR(ctx, 0x00570/4, 0x00000002);
	INSTANCE_WR(ctx, 0x0057c/4, 0x00000001);
	INSTANCE_WR(ctx, 0x00584/4, 0x00000002);
	INSTANCE_WR(ctx, 0x00588/4, 0x00001000);
	INSTANCE_WR(ctx, 0x0058c/4, 0x00000e00);
	INSTANCE_WR(ctx, 0x00590/4, 0x00001000);
	INSTANCE_WR(ctx, 0x00594/4, 0x00001e00);
	INSTANCE_WR(ctx, 0x0059c/4, 0x00000001);
	INSTANCE_WR(ctx, 0x005a0/4, 0x00000001);
	INSTANCE_WR(ctx, 0x005a4/4, 0x00000001);
	INSTANCE_WR(ctx, 0x005a8/4, 0x00000001);
	INSTANCE_WR(ctx, 0x005ac/4, 0x00000001);
	INSTANCE_WR(ctx, 0x005bc/4, 0x00000200);
	INSTANCE_WR(ctx, 0x005c4/4, 0x00000001);
	INSTANCE_WR(ctx, 0x005c8/4, 0x00000070);
	INSTANCE_WR(ctx, 0x005cc/4, 0x00000080);
	INSTANCE_WR(ctx, 0x005d8/4, 0x00000001);
	INSTANCE_WR(ctx, 0x005dc/4, 0x00000070);
	INSTANCE_WR(ctx, 0x005e0/4, 0x00000080);
	INSTANCE_WR(ctx, 0x005f0/4, 0x00000001);
	INSTANCE_WR(ctx, 0x005f4/4, 0x000000cf);
	INSTANCE_WR(ctx, 0x005fc/4, 0x00000001);
	INSTANCE_WR(ctx, 0x0060c/4, 0x000000cf);
	INSTANCE_WR(ctx, 0x00614/4, 0x00000002);
	INSTANCE_WR(ctx, 0x0061c/4, 0x00000001);
	INSTANCE_WR(ctx, 0x00624/4, 0x00000001);
	INSTANCE_WR(ctx, 0x0062c/4, 0x000000cf);
	INSTANCE_WR(ctx, 0x00630/4, 0x000000cf);
	INSTANCE_WR(ctx, 0x00634/4, 0x00000001);
	INSTANCE_WR(ctx, 0x0063c/4, 0x00000f80);
	INSTANCE_WR(ctx, 0x00684/4, 0x007f0080);
	INSTANCE_WR(ctx, 0x006c0/4, 0x007f0080);

	INSTANCE_WR(ctx, 0x006e4/4, 0x3b74f821);
	INSTANCE_WR(ctx, 0x006e8/4, 0x89058001);
	INSTANCE_WR(ctx, 0x006f0/4, 0x00001000);
	INSTANCE_WR(ctx, 0x006f4/4, 0x0000001f);
	INSTANCE_WR(ctx, 0x006f8/4, 0x027c10fa);
	INSTANCE_WR(ctx, 0x006fc/4, 0x400000c0);
	INSTANCE_WR(ctx, 0x00700/4, 0xb7892080);

	INSTANCE_WR(ctx, 0x0070c/4, 0x3b74f821);
	INSTANCE_WR(ctx, 0x00710/4, 0x89058001);
	INSTANCE_WR(ctx, 0x00718/4, 0x00001000);
	INSTANCE_WR(ctx, 0x0071c/4, 0x0000001f);
	INSTANCE_WR(ctx, 0x00720/4, 0x027c10fa);
	INSTANCE_WR(ctx, 0x00724/4, 0x400000c0);
	INSTANCE_WR(ctx, 0x00728/4, 0xb7892080);

	INSTANCE_WR(ctx, 0x00734/4, 0x3b74f821);
	INSTANCE_WR(ctx, 0x00738/4, 0x89058001);
	INSTANCE_WR(ctx, 0x00740/4, 0x00001000);
	INSTANCE_WR(ctx, 0x00744/4, 0x0000001f);
	INSTANCE_WR(ctx, 0x00748/4, 0x027c10fa);
	INSTANCE_WR(ctx, 0x0074c/4, 0x400000c0);
	INSTANCE_WR(ctx, 0x00750/4, 0xb7892080);

	INSTANCE_WR(ctx, 0x0075c/4, 0x3b74f821);
	INSTANCE_WR(ctx, 0x00760/4, 0x89058001);
	INSTANCE_WR(ctx, 0x00768/4, 0x00001000);
	INSTANCE_WR(ctx, 0x0076c/4, 0x0000001f);
	INSTANCE_WR(ctx, 0x00770/4, 0x027c10fa);
	INSTANCE_WR(ctx, 0x00774/4, 0x400000c0);
	INSTANCE_WR(ctx, 0x00778/4, 0xb7892080);

	INSTANCE_WR(ctx, 0x00784/4, 0x00010040);
	INSTANCE_WR(ctx, 0x0078c/4, 0x00000022);
	INSTANCE_WR(ctx, 0x00798/4, 0x00010040);
	INSTANCE_WR(ctx, 0x0079c/4, 0x00000022);

	INSTANCE_WR(ctx, 0x007b4/4, 0x01800000);
	INSTANCE_WR(ctx, 0x007b8/4, 0x00160000);
	INSTANCE_WR(ctx, 0x007bc/4, 0x01800000);
	INSTANCE_WR(ctx, 0x007cc/4, 0x0003ffff);
	INSTANCE_WR(ctx, 0x007d0/4, 0x00880000);
	INSTANCE_WR(ctx, 0x007f4/4, 0x00010401);
	INSTANCE_WR(ctx, 0x007fc/4, 0x00000078);
	INSTANCE_WR(ctx, 0x00804/4, 0x000000bf);
	INSTANCE_WR(ctx, 0x0080c/4, 0x00001210);
	INSTANCE_WR(ctx, 0x00810/4, 0x08000080);
	INSTANCE_WR(ctx, 0x00834/4, 0x01800000);
	INSTANCE_WR(ctx, 0x00838/4, 0x00160000);
	INSTANCE_WR(ctx, 0x0083c/4, 0x01800000);
	INSTANCE_WR(ctx, 0x0084c/4, 0x0003ffff);
	INSTANCE_WR(ctx, 0x00850/4, 0x00880000);
	INSTANCE_WR(ctx, 0x00874/4, 0x00010401);
	INSTANCE_WR(ctx, 0x0087c/4, 0x00000078);
	INSTANCE_WR(ctx, 0x00884/4, 0x000000bf);
	INSTANCE_WR(ctx, 0x0088c/4, 0x00001210);
	INSTANCE_WR(ctx, 0x00890/4, 0x08000080);
	INSTANCE_WR(ctx, 0x008b8/4, 0x00027070);
	INSTANCE_WR(ctx, 0x008c4/4, 0x03ffffff);
	INSTANCE_WR(ctx, 0x008dc/4, 0x00120407);
	INSTANCE_WR(ctx, 0x008e0/4, 0x05091507);
	INSTANCE_WR(ctx, 0x008e4/4, 0x05100202);
	INSTANCE_WR(ctx, 0x008e8/4, 0x00030201);
	INSTANCE_WR(ctx, 0x00904/4, 0x00000040);
	INSTANCE_WR(ctx, 0x00908/4, 0x0d0c0b0a);
	INSTANCE_WR(ctx, 0x0090c/4, 0x00141210);
	INSTANCE_WR(ctx, 0x00910/4, 0x000001f0);
	INSTANCE_WR(ctx, 0x00914/4, 0x00000001);
	INSTANCE_WR(ctx, 0x00918/4, 0x00000003);
	INSTANCE_WR(ctx, 0x00924/4, 0x00039e00);
	INSTANCE_WR(ctx, 0x00928/4, 0x00000100);
	INSTANCE_WR(ctx, 0x0092c/4, 0x00003800);
	INSTANCE_WR(ctx, 0x00930/4, 0x00404040);
	INSTANCE_WR(ctx, 0x00934/4, 0x0000ff0a);
	INSTANCE_WR(ctx, 0x0093c/4, 0x0077f005);
	INSTANCE_WR(ctx, 0x00940/4, 0x003f7fff);

	INSTANCE_WR(ctx, 0x00950/4, 0x01800000);
	INSTANCE_WR(ctx, 0x00954/4, 0x00160000);
	INSTANCE_WR(ctx, 0x00958/4, 0x01800000);
	INSTANCE_WR(ctx, 0x00968/4, 0x0003ffff);
	INSTANCE_WR(ctx, 0x0096c/4, 0x00880000);
	INSTANCE_WR(ctx, 0x00990/4, 0x00010401);
	INSTANCE_WR(ctx, 0x00998/4, 0x00000078);
	INSTANCE_WR(ctx, 0x009a0/4, 0x000000bf);
	INSTANCE_WR(ctx, 0x009a8/4, 0x00001210);
	INSTANCE_WR(ctx, 0x009ac/4, 0x08000080);
	INSTANCE_WR(ctx, 0x009d0/4, 0x01800000);
	INSTANCE_WR(ctx, 0x009d4/4, 0x00160000);
	INSTANCE_WR(ctx, 0x009d8/4, 0x01800000);
	INSTANCE_WR(ctx, 0x009e8/4, 0x0003ffff);
	INSTANCE_WR(ctx, 0x009ec/4, 0x00880000);
	INSTANCE_WR(ctx, 0x00a10/4, 0x00010401);
	INSTANCE_WR(ctx, 0x00a18/4, 0x00000078);
	INSTANCE_WR(ctx, 0x00a20/4, 0x000000bf);
	INSTANCE_WR(ctx, 0x00a28/4, 0x00001210);
	INSTANCE_WR(ctx, 0x00a2c/4, 0x08000080);
	INSTANCE_WR(ctx, 0x00a54/4, 0x00027070);
	INSTANCE_WR(ctx, 0x00a60/4, 0x03ffffff);
	INSTANCE_WR(ctx, 0x00a78/4, 0x00120407);
	INSTANCE_WR(ctx, 0x00a7c/4, 0x05091507);
	INSTANCE_WR(ctx, 0x00a80/4, 0x05100202);
	INSTANCE_WR(ctx, 0x00a84/4, 0x00030201);
	INSTANCE_WR(ctx, 0x00aa0/4, 0x00000040);
	INSTANCE_WR(ctx, 0x00aa4/4, 0x0d0c0b0a);
	INSTANCE_WR(ctx, 0x00aa8/4, 0x00141210);
	INSTANCE_WR(ctx, 0x00aac/4, 0x000001f0);
	INSTANCE_WR(ctx, 0x00ab0/4, 0x00000001);
	INSTANCE_WR(ctx, 0x00ab4/4, 0x00000003);
	INSTANCE_WR(ctx, 0x00ac0/4, 0x00039e00);
	INSTANCE_WR(ctx, 0x00ac4/4, 0x00000100);
	INSTANCE_WR(ctx, 0x00ac8/4, 0x00003800);
	INSTANCE_WR(ctx, 0x00acc/4, 0x00404040);
	INSTANCE_WR(ctx, 0x00ad0/4, 0x0000ff0a);
	INSTANCE_WR(ctx, 0x00ad8/4, 0x0077f005);
	INSTANCE_WR(ctx, 0x00adc/4, 0x003f7fff);

	INSTANCE_WR(ctx, 0x00aec/4, 0x01800000);
	INSTANCE_WR(ctx, 0x00af0/4, 0x00160000);
	INSTANCE_WR(ctx, 0x00af4/4, 0x01800000);
	INSTANCE_WR(ctx, 0x00b04/4, 0x0003ffff);
	INSTANCE_WR(ctx, 0x00b08/4, 0x00880000);
	INSTANCE_WR(ctx, 0x00b2c/4, 0x00010401);
	INSTANCE_WR(ctx, 0x00b34/4, 0x00000078);
	INSTANCE_WR(ctx, 0x00b3c/4, 0x000000bf);
	INSTANCE_WR(ctx, 0x00b44/4, 0x00001210);
	INSTANCE_WR(ctx, 0x00b48/4, 0x08000080);
	INSTANCE_WR(ctx, 0x00b6c/4, 0x01800000);
	INSTANCE_WR(ctx, 0x00b70/4, 0x00160000);
	INSTANCE_WR(ctx, 0x00b74/4, 0x01800000);
	INSTANCE_WR(ctx, 0x00b84/4, 0x0003ffff);
	INSTANCE_WR(ctx, 0x00b88/4, 0x00880000);
	INSTANCE_WR(ctx, 0x00bac/4, 0x00010401);
	INSTANCE_WR(ctx, 0x00bb4/4, 0x00000078);
	INSTANCE_WR(ctx, 0x00bbc/4, 0x000000bf);
	INSTANCE_WR(ctx, 0x00bc4/4, 0x00001210);
	INSTANCE_WR(ctx, 0x00bc8/4, 0x08000080);
	INSTANCE_WR(ctx, 0x00bf0/4, 0x00027070);
	INSTANCE_WR(ctx, 0x00bfc/4, 0x03ffffff);
	INSTANCE_WR(ctx, 0x00c14/4, 0x00120407);
	INSTANCE_WR(ctx, 0x00c18/4, 0x05091507);
	INSTANCE_WR(ctx, 0x00c1c/4, 0x05100202);
	INSTANCE_WR(ctx, 0x00c20/4, 0x00030201);
	INSTANCE_WR(ctx, 0x00c3c/4, 0x00000040);
	INSTANCE_WR(ctx, 0x00c40/4, 0x0d0c0b0a);
	INSTANCE_WR(ctx, 0x00c44/4, 0x00141210);
	INSTANCE_WR(ctx, 0x00c48/4, 0x000001f0);
	INSTANCE_WR(ctx, 0x00c4c/4, 0x00000001);
	INSTANCE_WR(ctx, 0x00c50/4, 0x00000003);
	INSTANCE_WR(ctx, 0x00c5c/4, 0x00039e00);
	INSTANCE_WR(ctx, 0x00c60/4, 0x00000100);
	INSTANCE_WR(ctx, 0x00c64/4, 0x00003800);
	INSTANCE_WR(ctx, 0x00c68/4, 0x00404040);
	INSTANCE_WR(ctx, 0x00c6c/4, 0x0000ff0a);
	INSTANCE_WR(ctx, 0x00c74/4, 0x0077f005);
	INSTANCE_WR(ctx, 0x00c78/4, 0x003f7fff);

	INSTANCE_WR(ctx, 0x00c88/4, 0x01800000);
	INSTANCE_WR(ctx, 0x00c8c/4, 0x00160000);
	INSTANCE_WR(ctx, 0x00c90/4, 0x01800000);
	INSTANCE_WR(ctx, 0x00ca0/4, 0x0003ffff);
	INSTANCE_WR(ctx, 0x00ca4/4, 0x00880000);
	INSTANCE_WR(ctx, 0x00cc8/4, 0x00010401);
	INSTANCE_WR(ctx, 0x00cd0/4, 0x00000078);
	INSTANCE_WR(ctx, 0x00cd8/4, 0x000000bf);
	INSTANCE_WR(ctx, 0x00ce0/4, 0x00001210);
	INSTANCE_WR(ctx, 0x00ce4/4, 0x08000080);
	INSTANCE_WR(ctx, 0x00d08/4, 0x01800000);
	INSTANCE_WR(ctx, 0x00d0c/4, 0x00160000);
	INSTANCE_WR(ctx, 0x00d10/4, 0x01800000);
	INSTANCE_WR(ctx, 0x00d20/4, 0x0003ffff);
	INSTANCE_WR(ctx, 0x00d24/4, 0x00880000);
	INSTANCE_WR(ctx, 0x00d48/4, 0x00010401);
	INSTANCE_WR(ctx, 0x00d50/4, 0x00000078);
	INSTANCE_WR(ctx, 0x00d58/4, 0x000000bf);
	INSTANCE_WR(ctx, 0x00d60/4, 0x00001210);
	INSTANCE_WR(ctx, 0x00d64/4, 0x08000080);
	INSTANCE_WR(ctx, 0x00d8c/4, 0x00027070);
	INSTANCE_WR(ctx, 0x00d98/4, 0x03ffffff);
	INSTANCE_WR(ctx, 0x00db0/4, 0x00120407);
	INSTANCE_WR(ctx, 0x00db4/4, 0x05091507);
	INSTANCE_WR(ctx, 0x00db8/4, 0x05100202);
	INSTANCE_WR(ctx, 0x00dbc/4, 0x00030201);
	INSTANCE_WR(ctx, 0x00dd8/4, 0x00000040);
	INSTANCE_WR(ctx, 0x00ddc/4, 0x0d0c0b0a);
	INSTANCE_WR(ctx, 0x00de0/4, 0x00141210);
	INSTANCE_WR(ctx, 0x00de4/4, 0x000001f0);
	INSTANCE_WR(ctx, 0x00de8/4, 0x00000001);
	INSTANCE_WR(ctx, 0x00dec/4, 0x00000003);
	INSTANCE_WR(ctx, 0x00df8/4, 0x00039e00);
	INSTANCE_WR(ctx, 0x00dfc/4, 0x00000100);
	INSTANCE_WR(ctx, 0x00e00/4, 0x00003800);
	INSTANCE_WR(ctx, 0x00e04/4, 0x00404040);
	INSTANCE_WR(ctx, 0x00e08/4, 0x0000ff0a);
	INSTANCE_WR(ctx, 0x00e10/4, 0x0077f005);
	INSTANCE_WR(ctx, 0x00e14/4, 0x003f7fff);

	INSTANCE_WR(ctx, 0x00e24/4, 0x01800000);
	INSTANCE_WR(ctx, 0x00e28/4, 0x00160000);
	INSTANCE_WR(ctx, 0x00e2c/4, 0x01800000);
	INSTANCE_WR(ctx, 0x00e3c/4, 0x0003ffff);
	INSTANCE_WR(ctx, 0x00e40/4, 0x00880000);
	INSTANCE_WR(ctx, 0x00e64/4, 0x00010401);
	INSTANCE_WR(ctx, 0x00e6c/4, 0x00000078);
	INSTANCE_WR(ctx, 0x00e74/4, 0x000000bf);
	INSTANCE_WR(ctx, 0x00e7c/4, 0x00001210);
	INSTANCE_WR(ctx, 0x00e80/4, 0x08000080);
	INSTANCE_WR(ctx, 0x00ea4/4, 0x01800000);
	INSTANCE_WR(ctx, 0x00ea8/4, 0x00160000);
	INSTANCE_WR(ctx, 0x00eac/4, 0x01800000);
	INSTANCE_WR(ctx, 0x00ebc/4, 0x0003ffff);
	INSTANCE_WR(ctx, 0x00ec0/4, 0x00880000);
	INSTANCE_WR(ctx, 0x00ee4/4, 0x00010401);
	INSTANCE_WR(ctx, 0x00eec/4, 0x00000078);
	INSTANCE_WR(ctx, 0x00ef4/4, 0x000000bf);
	INSTANCE_WR(ctx, 0x00efc/4, 0x00001210);
	INSTANCE_WR(ctx, 0x00f00/4, 0x08000080);
	INSTANCE_WR(ctx, 0x00f28/4, 0x00027070);
	INSTANCE_WR(ctx, 0x00f34/4, 0x03ffffff);
	INSTANCE_WR(ctx, 0x00f4c/4, 0x00120407);
	INSTANCE_WR(ctx, 0x00f50/4, 0x05091507);
	INSTANCE_WR(ctx, 0x00f54/4, 0x05100202);
	INSTANCE_WR(ctx, 0x00f58/4, 0x00030201);
	INSTANCE_WR(ctx, 0x00f74/4, 0x00000040);
	INSTANCE_WR(ctx, 0x00f78/4, 0x0d0c0b0a);
	INSTANCE_WR(ctx, 0x00f7c/4, 0x00141210);
	INSTANCE_WR(ctx, 0x00f80/4, 0x000001f0);
	INSTANCE_WR(ctx, 0x00f84/4, 0x00000001);
	INSTANCE_WR(ctx, 0x00f88/4, 0x00000003);
	INSTANCE_WR(ctx, 0x00f94/4, 0x00039e00);
	INSTANCE_WR(ctx, 0x00f98/4, 0x00000100);
	INSTANCE_WR(ctx, 0x00f9c/4, 0x00003800);
	INSTANCE_WR(ctx, 0x00fa0/4, 0x00404040);
	INSTANCE_WR(ctx, 0x00fa4/4, 0x0000ff0a);
	INSTANCE_WR(ctx, 0x00fac/4, 0x0077f005);
	INSTANCE_WR(ctx, 0x00fb0/4, 0x003f7fff);

	INSTANCE_WR(ctx, 0x00fc0/4, 0x01800000);
	INSTANCE_WR(ctx, 0x00fc4/4, 0x00160000);
	INSTANCE_WR(ctx, 0x00fc8/4, 0x01800000);
	INSTANCE_WR(ctx, 0x00fd8/4, 0x0003ffff);
	INSTANCE_WR(ctx, 0x00fdc/4, 0x00880000);
	INSTANCE_WR(ctx, 0x01000/4, 0x00010401);
	INSTANCE_WR(ctx, 0x01008/4, 0x00000078);
	INSTANCE_WR(ctx, 0x01010/4, 0x000000bf);
	INSTANCE_WR(ctx, 0x01018/4, 0x00001210);
	INSTANCE_WR(ctx, 0x0101c/4, 0x08000080);
	INSTANCE_WR(ctx, 0x01040/4, 0x01800000);
	INSTANCE_WR(ctx, 0x01044/4, 0x00160000);
	INSTANCE_WR(ctx, 0x01048/4, 0x01800000);
	INSTANCE_WR(ctx, 0x01058/4, 0x0003ffff);
	INSTANCE_WR(ctx, 0x0105c/4, 0x00880000);
	INSTANCE_WR(ctx, 0x01080/4, 0x00010401);
	INSTANCE_WR(ctx, 0x01088/4, 0x00000078);
	INSTANCE_WR(ctx, 0x01090/4, 0x000000bf);
	INSTANCE_WR(ctx, 0x01098/4, 0x00001210);
	INSTANCE_WR(ctx, 0x0109c/4, 0x08000080);
	INSTANCE_WR(ctx, 0x010c4/4, 0x00027070);
	INSTANCE_WR(ctx, 0x010d0/4, 0x03ffffff);
	INSTANCE_WR(ctx, 0x010e8/4, 0x00120407);
	INSTANCE_WR(ctx, 0x010ec/4, 0x05091507);
	INSTANCE_WR(ctx, 0x010f0/4, 0x05100202);
	INSTANCE_WR(ctx, 0x010f4/4, 0x00030201);
	INSTANCE_WR(ctx, 0x01110/4, 0x00000040);
	INSTANCE_WR(ctx, 0x01114/4, 0x0d0c0b0a);
	INSTANCE_WR(ctx, 0x01118/4, 0x00141210);
	INSTANCE_WR(ctx, 0x0111c/4, 0x000001f0);
	INSTANCE_WR(ctx, 0x01120/4, 0x00000001);
	INSTANCE_WR(ctx, 0x01124/4, 0x00000003);
	INSTANCE_WR(ctx, 0x01130/4, 0x00039e00);
	INSTANCE_WR(ctx, 0x01134/4, 0x00000100);
	INSTANCE_WR(ctx, 0x01138/4, 0x00003800);
	INSTANCE_WR(ctx, 0x0113c/4, 0x00404040);
	INSTANCE_WR(ctx, 0x01140/4, 0x0000ff0a);
	INSTANCE_WR(ctx, 0x01148/4, 0x0077f005);
	INSTANCE_WR(ctx, 0x0114c/4, 0x003f7fff);

	INSTANCE_WR(ctx, 0x01230/4, 0x00000004);
	INSTANCE_WR(ctx, 0x01284/4, 0x0000000f);
	INSTANCE_WR(ctx, 0x0130c/4, 0x00000002);
	INSTANCE_WR(ctx, 0x01324/4, 0x00000020);
	INSTANCE_WR(ctx, 0x0134c/4, 0x001ffe67);
	INSTANCE_WR(ctx, 0x014ec/4, 0x00000001);
	INSTANCE_WR(ctx, 0x014f0/4, 0x00000004);
	INSTANCE_WR(ctx, 0x01504/4, 0x0000001a);
	INSTANCE_WR(ctx, 0x0150c/4, 0x00000010);
	INSTANCE_WR(ctx, 0x01510/4, 0x00000004);
	INSTANCE_WR(ctx, 0x01530/4, 0x00608080);
	INSTANCE_WR(ctx, 0x0156c/4, 0x00000001);
	INSTANCE_WR(ctx, 0x015d0/4, 0x00000004);
	INSTANCE_WR(ctx, 0x01630/4, 0x00000004);
	INSTANCE_WR(ctx, 0x0164c/4, 0x00000002);
	INSTANCE_WR(ctx, 0x01650/4, 0x00000004);
	INSTANCE_WR(ctx, 0x01670/4, 0x00000080);
	INSTANCE_WR(ctx, 0x01690/4, 0x00000004);
	INSTANCE_WR(ctx, 0x016c4/4, 0x00000004);
	INSTANCE_WR(ctx, 0x016e4/4, 0x00000004);
	INSTANCE_WR(ctx, 0x01724/4, 0x00000004);
	INSTANCE_WR(ctx, 0x01744/4, 0x00000008);
	INSTANCE_WR(ctx, 0x0176c/4, 0x00000001);
	INSTANCE_WR(ctx, 0x01784/4, 0x000007ff);
	INSTANCE_WR(ctx, 0x0178c/4, 0x00000010);
	INSTANCE_WR(ctx, 0x017cc/4, 0x00000001);
	INSTANCE_WR(ctx, 0x01924/4, 0x0000000f);
	INSTANCE_WR(ctx, 0x01a4c/4, 0x00000010);
	INSTANCE_WR(ctx, 0x01b30/4, 0x00000004);
	INSTANCE_WR(ctx, 0x01b50/4, 0x00000080);
	INSTANCE_WR(ctx, 0x01b70/4, 0x00000004);
	INSTANCE_WR(ctx, 0x01b90/4, 0x03020100);
	INSTANCE_WR(ctx, 0x01bb0/4, 0x00000003);
	INSTANCE_WR(ctx, 0x01bd0/4, 0x00000004);
	INSTANCE_WR(ctx, 0x01c6c/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x01c70/4, 0x00000004);
	INSTANCE_WR(ctx, 0x01c8c/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x01c90/4, 0x00000003);
	INSTANCE_WR(ctx, 0x01cac/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x01ccc/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x01cec/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x01d0c/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x01d10/4, 0x00000004);
	INSTANCE_WR(ctx, 0x01d2c/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x01d4c/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x01d6c/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x01d8c/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x01dac/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x01dcc/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x01dec/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x01e0c/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x01e2c/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x01e4c/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x0218c/4, 0x00000010);
	INSTANCE_WR(ctx, 0x021cc/4, 0x0000003f);
	INSTANCE_WR(ctx, 0x022ac/4, 0x00000001);
	INSTANCE_WR(ctx, 0x022ec/4, 0x00000001);
	INSTANCE_WR(ctx, 0x0232c/4, 0x00000001);
	INSTANCE_WR(ctx, 0x024cc/4, 0x00000011);
	INSTANCE_WR(ctx, 0x025cc/4, 0x0000000f);
	INSTANCE_WR(ctx, 0x026cc/4, 0x00000011);
	INSTANCE_WR(ctx, 0x027ac/4, 0x00000001);
	INSTANCE_WR(ctx, 0x027cc/4, 0x00000001);
	INSTANCE_WR(ctx, 0x027ec/4, 0x00000001);
	INSTANCE_WR(ctx, 0x0280c/4, 0x00000002);
	INSTANCE_WR(ctx, 0x0282c/4, 0x00000001);
	INSTANCE_WR(ctx, 0x0284c/4, 0x00000002);
	INSTANCE_WR(ctx, 0x0286c/4, 0x00000001);
	INSTANCE_WR(ctx, 0x028ac/4, 0x001ffe67);
	INSTANCE_WR(ctx, 0x028ec/4, 0x0fac6881);
	INSTANCE_WR(ctx, 0x02bac/4, 0x00000001);
	INSTANCE_WR(ctx, 0x02bcc/4, 0x00000002);
	INSTANCE_WR(ctx, 0x02bec/4, 0x00000001);
	INSTANCE_WR(ctx, 0x02c0c/4, 0x00000001);
	INSTANCE_WR(ctx, 0x02c2c/4, 0x00000002);
	INSTANCE_WR(ctx, 0x02c4c/4, 0x00000001);
	INSTANCE_WR(ctx, 0x02c6c/4, 0x00000001);
	INSTANCE_WR(ctx, 0x02cec/4, 0x00000011);
	INSTANCE_WR(ctx, 0x02d0c/4, 0x00000001);
	INSTANCE_WR(ctx, 0x0398c/4, 0x00000002);
	INSTANCE_WR(ctx, 0x039cc/4, 0x001ffe67);
	INSTANCE_WR(ctx, 0x03b6c/4, 0x00000001);
	INSTANCE_WR(ctx, 0x03b8c/4, 0x00000010);
	INSTANCE_WR(ctx, 0x03bec/4, 0x00000001);
	INSTANCE_WR(ctx, 0x03ccc/4, 0x00000002);
	INSTANCE_WR(ctx, 0x03dec/4, 0x00000001);
	INSTANCE_WR(ctx, 0x03e04/4, 0x0000000f);
	INSTANCE_WR(ctx, 0x03e0c/4, 0x00000010);
	INSTANCE_WR(ctx, 0x03e44/4, 0x00000001);
	INSTANCE_WR(ctx, 0x03e4c/4, 0x00000001);
	INSTANCE_WR(ctx, 0x040cc/4, 0x00000010);
	INSTANCE_WR(ctx, 0x042ec/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x0430c/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x0432c/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x0434c/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x0436c/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x0438c/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x043ac/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x043cc/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x043ec/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x0440c/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x0442c/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x0444c/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x0446c/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x0448c/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x044ac/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x044cc/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x0480c/4, 0x00000010);
	INSTANCE_WR(ctx, 0x0484c/4, 0x0000003f);
	INSTANCE_WR(ctx, 0x0492c/4, 0x00000001);
	INSTANCE_WR(ctx, 0x0496c/4, 0x00000001);
	INSTANCE_WR(ctx, 0x049a4/4, 0x0000000f);
	INSTANCE_WR(ctx, 0x049ac/4, 0x00000001);
	INSTANCE_WR(ctx, 0x04b4c/4, 0x00000011);
	INSTANCE_WR(ctx, 0x04c4c/4, 0x0000000f);
	INSTANCE_WR(ctx, 0x04d4c/4, 0x00000011);
	INSTANCE_WR(ctx, 0x04e2c/4, 0x00000001);
	INSTANCE_WR(ctx, 0x04e4c/4, 0x00000001);
	INSTANCE_WR(ctx, 0x04e6c/4, 0x00000001);
	INSTANCE_WR(ctx, 0x04e8c/4, 0x00000002);
	INSTANCE_WR(ctx, 0x04eac/4, 0x00000001);
	INSTANCE_WR(ctx, 0x04ecc/4, 0x00000002);
	INSTANCE_WR(ctx, 0x04eec/4, 0x00000001);
	INSTANCE_WR(ctx, 0x04f2c/4, 0x001ffe67);
	INSTANCE_WR(ctx, 0x04f6c/4, 0x0fac6881);
	INSTANCE_WR(ctx, 0x0522c/4, 0x00000001);
	INSTANCE_WR(ctx, 0x0524c/4, 0x00000002);
	INSTANCE_WR(ctx, 0x0526c/4, 0x00000001);
	INSTANCE_WR(ctx, 0x0528c/4, 0x00000001);
	INSTANCE_WR(ctx, 0x052ac/4, 0x00000002);
	INSTANCE_WR(ctx, 0x052cc/4, 0x00000001);
	INSTANCE_WR(ctx, 0x052ec/4, 0x00000001);
	INSTANCE_WR(ctx, 0x0536c/4, 0x00000011);
	INSTANCE_WR(ctx, 0x0538c/4, 0x00000001);
	INSTANCE_WR(ctx, 0x083a0/4, 0x00000021);
	INSTANCE_WR(ctx, 0x083c0/4, 0x00000001);
	INSTANCE_WR(ctx, 0x083e0/4, 0x00000002);
	INSTANCE_WR(ctx, 0x08400/4, 0x00000100);
	INSTANCE_WR(ctx, 0x08420/4, 0x00000100);
	INSTANCE_WR(ctx, 0x08440/4, 0x00000001);
	INSTANCE_WR(ctx, 0x084a0/4, 0x00000001);
	INSTANCE_WR(ctx, 0x084c0/4, 0x00000002);
	INSTANCE_WR(ctx, 0x084e0/4, 0x00000100);
	INSTANCE_WR(ctx, 0x08500/4, 0x00000100);
	INSTANCE_WR(ctx, 0x08520/4, 0x00000001);
	INSTANCE_WR(ctx, 0x11e40/4, 0x00000004);
	INSTANCE_WR(ctx, 0x11e60/4, 0x00000004);
	INSTANCE_WR(ctx, 0x15044/4, 0x0000000f);
	INSTANCE_WR(ctx, 0x152e4/4, 0x00000001);
	INSTANCE_WR(ctx, 0x15304/4, 0x00000100);
	INSTANCE_WR(ctx, 0x15324/4, 0x00000100);
	INSTANCE_WR(ctx, 0x15344/4, 0x00000011);
	INSTANCE_WR(ctx, 0x15384/4, 0x00000008);
	INSTANCE_WR(ctx, 0x15444/4, 0x00000001);
	INSTANCE_WR(ctx, 0x15484/4, 0x00000001);
	INSTANCE_WR(ctx, 0x154a4/4, 0x00000001);
	INSTANCE_WR(ctx, 0x154c4/4, 0x00000001);
	INSTANCE_WR(ctx, 0x154e4/4, 0x000000cf);
	INSTANCE_WR(ctx, 0x15504/4, 0x00000002);
	INSTANCE_WR(ctx, 0x155e4/4, 0x00000001);
	INSTANCE_WR(ctx, 0x15624/4, 0x00000001);
	INSTANCE_WR(ctx, 0x15644/4, 0x00000001);
	INSTANCE_WR(ctx, 0x15664/4, 0x00000001);
	INSTANCE_WR(ctx, 0x15704/4, 0x00000004);
	INSTANCE_WR(ctx, 0x15744/4, 0x00000001);
	INSTANCE_WR(ctx, 0x15764/4, 0x00000015);
	INSTANCE_WR(ctx, 0x157e4/4, 0x04444480);
	INSTANCE_WR(ctx, 0x15f64/4, 0x08100c12);
	INSTANCE_WR(ctx, 0x16004/4, 0x00000100);
	INSTANCE_WR(ctx, 0x16064/4, 0x00010001);
	INSTANCE_WR(ctx, 0x160a4/4, 0x00010001);
	INSTANCE_WR(ctx, 0x160c4/4, 0x00000001);
	INSTANCE_WR(ctx, 0x160e4/4, 0x00010001);
	INSTANCE_WR(ctx, 0x16104/4, 0x00000001);
	INSTANCE_WR(ctx, 0x16124/4, 0x00000004);
	INSTANCE_WR(ctx, 0x16144/4, 0x00000002);
	INSTANCE_WR(ctx, 0x161b0/4, 0x00000004);
	INSTANCE_WR(ctx, 0x161c8/4, 0x003fffff);
	INSTANCE_WR(ctx, 0x161d0/4, 0x00000003);
	INSTANCE_WR(ctx, 0x16228/4, 0x00001fff);
	INSTANCE_WR(ctx, 0x16408/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x16410/4, 0x0000000f);
	INSTANCE_WR(ctx, 0x164e8/4, 0x00000004);
	INSTANCE_WR(ctx, 0x16508/4, 0x0000001a);
	INSTANCE_WR(ctx, 0x16568/4, 0x00000001);
	INSTANCE_WR(ctx, 0x16590/4, 0x00000004);
	INSTANCE_WR(ctx, 0x165b0/4, 0x0000ffff);
	INSTANCE_WR(ctx, 0x165d0/4, 0x0000ffff);
	INSTANCE_WR(ctx, 0x165f0/4, 0x0000ffff);
	INSTANCE_WR(ctx, 0x16610/4, 0x0000ffff);
	INSTANCE_WR(ctx, 0x16730/4, 0x00000001);
	INSTANCE_WR(ctx, 0x167b0/4, 0x00000001);
	INSTANCE_WR(ctx, 0x167c8/4, 0x00ffff00);
	INSTANCE_WR(ctx, 0x16870/4, 0x00000001);
	INSTANCE_WR(ctx, 0x168a8/4, 0x0000000f);
	INSTANCE_WR(ctx, 0x169a8/4, 0x0fac6881);
	INSTANCE_WR(ctx, 0x169c8/4, 0x00000011);
	INSTANCE_WR(ctx, 0x16a10/4, 0x00000001);
	INSTANCE_WR(ctx, 0x16a30/4, 0x00000001);
	INSTANCE_WR(ctx, 0x16a50/4, 0x00000002);
	INSTANCE_WR(ctx, 0x16a70/4, 0x00000001);
	INSTANCE_WR(ctx, 0x16a90/4, 0x00000001);
	INSTANCE_WR(ctx, 0x16ab0/4, 0x00000002);
	INSTANCE_WR(ctx, 0x16ad0/4, 0x00000001);
	INSTANCE_WR(ctx, 0x16b10/4, 0x00000011);
	INSTANCE_WR(ctx, 0x16bc8/4, 0x00000004);
	INSTANCE_WR(ctx, 0x16c10/4, 0x0fac6881);
	INSTANCE_WR(ctx, 0x16c68/4, 0x00000002);
	INSTANCE_WR(ctx, 0x16c70/4, 0x00000004);
	INSTANCE_WR(ctx, 0x16c88/4, 0x04000000);
	INSTANCE_WR(ctx, 0x16ca8/4, 0x04000000);
	INSTANCE_WR(ctx, 0x16cf0/4, 0x00000011);
	INSTANCE_WR(ctx, 0x16d10/4, 0x00000001);
	INSTANCE_WR(ctx, 0x16d28/4, 0x00000005);
	INSTANCE_WR(ctx, 0x16d48/4, 0x00000052);
	INSTANCE_WR(ctx, 0x16d50/4, 0x000000cf);
	INSTANCE_WR(ctx, 0x16d70/4, 0x000000cf);
	INSTANCE_WR(ctx, 0x16d90/4, 0x000000cf);
	INSTANCE_WR(ctx, 0x16de8/4, 0x00000001);
	INSTANCE_WR(ctx, 0x16ef0/4, 0x00000001);
	INSTANCE_WR(ctx, 0x16f10/4, 0x00000001);
	INSTANCE_WR(ctx, 0x16f30/4, 0x00000002);
	INSTANCE_WR(ctx, 0x16f50/4, 0x00000001);
	INSTANCE_WR(ctx, 0x16f70/4, 0x00000001);
	INSTANCE_WR(ctx, 0x16f90/4, 0x00000002);
	INSTANCE_WR(ctx, 0x16fb0/4, 0x00000001);
	INSTANCE_WR(ctx, 0x16ff0/4, 0x00000001);
	INSTANCE_WR(ctx, 0x17008/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x17010/4, 0x00000001);
	INSTANCE_WR(ctx, 0x17028/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x17030/4, 0x00000001);
	INSTANCE_WR(ctx, 0x17048/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x17050/4, 0x00000001);
	INSTANCE_WR(ctx, 0x17068/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x17070/4, 0x00000001);
	INSTANCE_WR(ctx, 0x17088/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x17090/4, 0x00000001);
	INSTANCE_WR(ctx, 0x170a8/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x170b0/4, 0x00000001);
	INSTANCE_WR(ctx, 0x170c8/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x170d0/4, 0x00000001);
	INSTANCE_WR(ctx, 0x170e8/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x170f0/4, 0x00000011);
	INSTANCE_WR(ctx, 0x17108/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x17128/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x17148/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x17168/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x17188/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x171a8/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x171c8/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x171e8/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x171f0/4, 0x0fac6881);
	INSTANCE_WR(ctx, 0x17208/4, 0x00000010);
	INSTANCE_WR(ctx, 0x17210/4, 0x0000000f);
	INSTANCE_WR(ctx, 0x17310/4, 0x001ffe67);
	INSTANCE_WR(ctx, 0x17370/4, 0x00000011);
	INSTANCE_WR(ctx, 0x17390/4, 0x00000001);
	INSTANCE_WR(ctx, 0x17410/4, 0x00000004);
	INSTANCE_WR(ctx, 0x174d0/4, 0x00000001);
	INSTANCE_WR(ctx, 0x17570/4, 0x00000011);
	INSTANCE_WR(ctx, 0x17670/4, 0x0fac6881);
	INSTANCE_WR(ctx, 0x176e8/4, 0x08100c12);
	INSTANCE_WR(ctx, 0x176f0/4, 0x00000011);
	INSTANCE_WR(ctx, 0x17708/4, 0x00000005);
	INSTANCE_WR(ctx, 0x17710/4, 0x00000001);
	INSTANCE_WR(ctx, 0x17750/4, 0x00000001);
	INSTANCE_WR(ctx, 0x17768/4, 0x00000001);
	INSTANCE_WR(ctx, 0x17790/4, 0x00000001);
	INSTANCE_WR(ctx, 0x177a8/4, 0x0000ffff);
	INSTANCE_WR(ctx, 0x177c8/4, 0x0000ffff);
	INSTANCE_WR(ctx, 0x177d0/4, 0x000007ff);
	INSTANCE_WR(ctx, 0x177e8/4, 0x0000ffff);
	INSTANCE_WR(ctx, 0x17808/4, 0x0000ffff);
	INSTANCE_WR(ctx, 0x17810/4, 0x00000001);
	INSTANCE_WR(ctx, 0x17828/4, 0x00000003);
	INSTANCE_WR(ctx, 0x17850/4, 0x00000001);
	INSTANCE_WR(ctx, 0x17bc4/4, 0x04e3bfdf);
	INSTANCE_WR(ctx, 0x17be4/4, 0x04e3bfdf);
	INSTANCE_WR(ctx, 0x17c28/4, 0x00ffff00);
	INSTANCE_WR(ctx, 0x17c48/4, 0x0000001a);
	INSTANCE_WR(ctx, 0x17c84/4, 0x0fac6881);
	INSTANCE_WR(ctx, 0x17c88/4, 0x00000003);
	INSTANCE_WR(ctx, 0x17db0/4, 0x00000008);
	INSTANCE_WR(ctx, 0x17dd0/4, 0x00000008);
	INSTANCE_WR(ctx, 0x17df0/4, 0x00000008);
	INSTANCE_WR(ctx, 0x17e04/4, 0x04e3bfdf);
	INSTANCE_WR(ctx, 0x17e10/4, 0x00000008);
	INSTANCE_WR(ctx, 0x17e24/4, 0x04e3bfdf);
	INSTANCE_WR(ctx, 0x17e30/4, 0x00000008);
	INSTANCE_WR(ctx, 0x17e50/4, 0x00000008);
	INSTANCE_WR(ctx, 0x17e70/4, 0x00000008);
	INSTANCE_WR(ctx, 0x17e90/4, 0x00000008);
	INSTANCE_WR(ctx, 0x17eb0/4, 0x00000011);
	INSTANCE_WR(ctx, 0x17fb0/4, 0x0fac6881);
	INSTANCE_WR(ctx, 0x17fd0/4, 0x00000400);
	INSTANCE_WR(ctx, 0x17ff0/4, 0x00000400);
	INSTANCE_WR(ctx, 0x18010/4, 0x00000400);
	INSTANCE_WR(ctx, 0x18030/4, 0x00000400);
	INSTANCE_WR(ctx, 0x18050/4, 0x00000400);
	INSTANCE_WR(ctx, 0x18070/4, 0x00000400);
	INSTANCE_WR(ctx, 0x18090/4, 0x00000400);
	INSTANCE_WR(ctx, 0x180b0/4, 0x00000400);
	INSTANCE_WR(ctx, 0x180d0/4, 0x00000300);
	INSTANCE_WR(ctx, 0x180f0/4, 0x00000300);
	INSTANCE_WR(ctx, 0x18110/4, 0x00000300);
	INSTANCE_WR(ctx, 0x18130/4, 0x00000300);
	INSTANCE_WR(ctx, 0x18150/4, 0x00000300);
	INSTANCE_WR(ctx, 0x18168/4, 0x00000102);
	INSTANCE_WR(ctx, 0x18170/4, 0x00000300);
	INSTANCE_WR(ctx, 0x18190/4, 0x00000300);
	INSTANCE_WR(ctx, 0x181a8/4, 0x00000004);
	INSTANCE_WR(ctx, 0x181b0/4, 0x00000300);
	INSTANCE_WR(ctx, 0x181c8/4, 0x00000004);
	INSTANCE_WR(ctx, 0x181d0/4, 0x00000001);
	INSTANCE_WR(ctx, 0x181e8/4, 0x00000004);
	INSTANCE_WR(ctx, 0x181f0/4, 0x0000000f);
	INSTANCE_WR(ctx, 0x18208/4, 0x00000004);
	INSTANCE_WR(ctx, 0x18228/4, 0x00000004);
	INSTANCE_WR(ctx, 0x18248/4, 0x00000004);
	INSTANCE_WR(ctx, 0x18288/4, 0x000007ff);
	INSTANCE_WR(ctx, 0x182c8/4, 0x00000102);
	INSTANCE_WR(ctx, 0x182f0/4, 0x00000020);
	INSTANCE_WR(ctx, 0x18310/4, 0x00000011);
	INSTANCE_WR(ctx, 0x18330/4, 0x00000100);
	INSTANCE_WR(ctx, 0x18370/4, 0x00000001);
	INSTANCE_WR(ctx, 0x183d0/4, 0x00000040);
	INSTANCE_WR(ctx, 0x183f0/4, 0x00000100);
	INSTANCE_WR(ctx, 0x18408/4, 0x00000004);
	INSTANCE_WR(ctx, 0x18428/4, 0x00000004);
	INSTANCE_WR(ctx, 0x18430/4, 0x00000003);
	INSTANCE_WR(ctx, 0x18448/4, 0x00000004);
	INSTANCE_WR(ctx, 0x18468/4, 0x00000004);
	INSTANCE_WR(ctx, 0x184d0/4, 0x001ffe67);
	INSTANCE_WR(ctx, 0x18550/4, 0x00000002);
	INSTANCE_WR(ctx, 0x18570/4, 0x0fac6881);
	INSTANCE_WR(ctx, 0x186b0/4, 0x00000001);
	INSTANCE_WR(ctx, 0x18750/4, 0x00000004);
	INSTANCE_WR(ctx, 0x18790/4, 0x00000001);
	INSTANCE_WR(ctx, 0x187b0/4, 0x00000400);
	INSTANCE_WR(ctx, 0x187d0/4, 0x00000300);
	INSTANCE_WR(ctx, 0x187f0/4, 0x00001001);
	INSTANCE_WR(ctx, 0x18870/4, 0x00000011);
	INSTANCE_WR(ctx, 0x18970/4, 0x0fac6881);
	INSTANCE_WR(ctx, 0x18990/4, 0x0000000f);
	INSTANCE_WR(ctx, 0x18aa8/4, 0x00080c14);
	INSTANCE_WR(ctx, 0x18b08/4, 0x00000804);
	INSTANCE_WR(ctx, 0x18b48/4, 0x00000004);
	INSTANCE_WR(ctx, 0x18b68/4, 0x00000004);
	INSTANCE_WR(ctx, 0x18b88/4, 0x08100c12);
	INSTANCE_WR(ctx, 0x18bc8/4, 0x00000004);
	INSTANCE_WR(ctx, 0x18be8/4, 0x00000004);
	INSTANCE_WR(ctx, 0x18c28/4, 0x00000010);
	INSTANCE_WR(ctx, 0x18c90/4, 0x001ffe67);
	INSTANCE_WR(ctx, 0x18cc8/4, 0x00000804);
	INSTANCE_WR(ctx, 0x18ce8/4, 0x00000001);
	INSTANCE_WR(ctx, 0x18d08/4, 0x0000001a);
	INSTANCE_WR(ctx, 0x18d10/4, 0x00000011);
	INSTANCE_WR(ctx, 0x18d28/4, 0x0000007f);
	INSTANCE_WR(ctx, 0x18d68/4, 0x00000001);
	INSTANCE_WR(ctx, 0x18d70/4, 0x00000004);
	INSTANCE_WR(ctx, 0x18d88/4, 0x00080c14);
	INSTANCE_WR(ctx, 0x18db0/4, 0x00000001);
	INSTANCE_WR(ctx, 0x18dc8/4, 0x08100c12);
	INSTANCE_WR(ctx, 0x18dd0/4, 0x00000001);
	INSTANCE_WR(ctx, 0x18de8/4, 0x00000004);
	INSTANCE_WR(ctx, 0x18e08/4, 0x00000004);
	INSTANCE_WR(ctx, 0x18e48/4, 0x00000010);
	INSTANCE_WR(ctx, 0x18e50/4, 0x00000001);
	INSTANCE_WR(ctx, 0x18ec8/4, 0x00000001);
	INSTANCE_WR(ctx, 0x18ee8/4, 0x08100c12);
	INSTANCE_WR(ctx, 0x18ef0/4, 0x00000001);
	INSTANCE_WR(ctx, 0x18f30/4, 0x00000001);
	INSTANCE_WR(ctx, 0x18fb0/4, 0x2a712488);
	INSTANCE_WR(ctx, 0x18fc8/4, 0x000007ff);
	INSTANCE_WR(ctx, 0x18fe8/4, 0x00080c14);
	INSTANCE_WR(ctx, 0x18ff0/4, 0x4085c000);
	INSTANCE_WR(ctx, 0x19010/4, 0x00000040);
	INSTANCE_WR(ctx, 0x19030/4, 0x00000100);
	INSTANCE_WR(ctx, 0x19050/4, 0x00010100);
	INSTANCE_WR(ctx, 0x19070/4, 0x02800000);
	INSTANCE_WR(ctx, 0x192d0/4, 0x04e3bfdf);
	INSTANCE_WR(ctx, 0x192f0/4, 0x04e3bfdf);
	INSTANCE_WR(ctx, 0x19310/4, 0x00000001);
	INSTANCE_WR(ctx, 0x19350/4, 0x00ffff00);
	INSTANCE_WR(ctx, 0x19370/4, 0x00000001);
	INSTANCE_WR(ctx, 0x193d0/4, 0x00ffff00);
	INSTANCE_WR(ctx, 0x194f0/4, 0x00000001);
	INSTANCE_WR(ctx, 0x19530/4, 0x00000001);
	INSTANCE_WR(ctx, 0x19550/4, 0x30201000);
	INSTANCE_WR(ctx, 0x19570/4, 0x70605040);
	INSTANCE_WR(ctx, 0x19590/4, 0xb8a89888);
	INSTANCE_WR(ctx, 0x195b0/4, 0xf8e8d8c8);
	INSTANCE_WR(ctx, 0x195f0/4, 0x0000001a);
	INSTANCE_WR(ctx, 0x19630/4, 0x00000004);
	INSTANCE_WR(ctx, 0x19708/4, 0x00000001);
	INSTANCE_WR(ctx, 0x19768/4, 0x00000010);
	INSTANCE_WR(ctx, 0x198f0/4, 0x00000004);
	INSTANCE_WR(ctx, 0x19910/4, 0x00000004);
	INSTANCE_WR(ctx, 0x19930/4, 0x00608080);
	INSTANCE_WR(ctx, 0x199d0/4, 0x00000004);
	INSTANCE_WR(ctx, 0x19a30/4, 0x00000004);
	INSTANCE_WR(ctx, 0x19a50/4, 0x00000004);
	INSTANCE_WR(ctx, 0x19a70/4, 0x00000080);
	INSTANCE_WR(ctx, 0x19a90/4, 0x00000004);
	INSTANCE_WR(ctx, 0x19e88/4, 0x00000088);
	INSTANCE_WR(ctx, 0x19ea8/4, 0x00000088);
	INSTANCE_WR(ctx, 0x19f08/4, 0x00000004);
	INSTANCE_WR(ctx, 0x19f30/4, 0x00000004);
	INSTANCE_WR(ctx, 0x19f50/4, 0x00000080);
	INSTANCE_WR(ctx, 0x19f70/4, 0x00000004);
	INSTANCE_WR(ctx, 0x19f90/4, 0x03020100);
	INSTANCE_WR(ctx, 0x19fb0/4, 0x00000003);
	INSTANCE_WR(ctx, 0x19fd0/4, 0x00000004);
	INSTANCE_WR(ctx, 0x1a070/4, 0x00000004);
	INSTANCE_WR(ctx, 0x1a090/4, 0x00000003);
	INSTANCE_WR(ctx, 0x1a110/4, 0x00000004);
	INSTANCE_WR(ctx, 0x1a1e8/4, 0x00000026);
	INSTANCE_WR(ctx, 0x1a248/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x1a2c8/4, 0x0000001a);
	INSTANCE_WR(ctx, 0x1a2e8/4, 0x00000010);
	INSTANCE_WR(ctx, 0x1a808/4, 0x00000052);
	INSTANCE_WR(ctx, 0x1a848/4, 0x00000026);
	INSTANCE_WR(ctx, 0x1a888/4, 0x00000004);
	INSTANCE_WR(ctx, 0x1a8a8/4, 0x00000004);
	INSTANCE_WR(ctx, 0x1a8e8/4, 0x0000001a);
	INSTANCE_WR(ctx, 0x1a948/4, 0x00ffff00);
	INSTANCE_WR(ctx, 0x1a988/4, 0x00000004);
	INSTANCE_WR(ctx, 0x1a9a8/4, 0x00000004);
	INSTANCE_WR(ctx, 0x1a9e8/4, 0x00000080);
	INSTANCE_WR(ctx, 0x1aa08/4, 0x00000004);
	INSTANCE_WR(ctx, 0x1aa28/4, 0x00080c14);
	INSTANCE_WR(ctx, 0x1aa68/4, 0x000007ff);
	INSTANCE_WR(ctx, 0x2d2c8/4, 0x00000004);
	INSTANCE_WR(ctx, 0x2d2e8/4, 0x00000004);
	INSTANCE_WR(ctx, 0x2d328/4, 0x00000080);
	INSTANCE_WR(ctx, 0x2d348/4, 0x00000004);
	INSTANCE_WR(ctx, 0x2d368/4, 0x00000001);
	INSTANCE_WR(ctx, 0x2d3a8/4, 0x00000027);
	INSTANCE_WR(ctx, 0x2d3e8/4, 0x00000026);
	INSTANCE_WR(ctx, 0x2d468/4, 0x04000000);
	INSTANCE_WR(ctx, 0x2d488/4, 0x04000000);
	INSTANCE_WR(ctx, 0x2d4a8/4, 0x04000000);
	INSTANCE_WR(ctx, 0x2d4c8/4, 0x04000000);
	INSTANCE_WR(ctx, 0x2d4e8/4, 0x04000000);
	INSTANCE_WR(ctx, 0x2d508/4, 0x04000000);
	INSTANCE_WR(ctx, 0x2d528/4, 0x04000000);
	INSTANCE_WR(ctx, 0x2d548/4, 0x04000000);
	INSTANCE_WR(ctx, 0x2d568/4, 0x04000000);
	INSTANCE_WR(ctx, 0x2d588/4, 0x04000000);
	INSTANCE_WR(ctx, 0x2d5a8/4, 0x04000000);
	INSTANCE_WR(ctx, 0x2d5c8/4, 0x04000000);
	INSTANCE_WR(ctx, 0x2d5e8/4, 0x04000000);
	INSTANCE_WR(ctx, 0x2d608/4, 0x04000000);
	INSTANCE_WR(ctx, 0x2d628/4, 0x04000000);
	INSTANCE_WR(ctx, 0x2d648/4, 0x04000000);
	INSTANCE_WR(ctx, 0x2dae8/4, 0x04e3bfdf);
	INSTANCE_WR(ctx, 0x2db08/4, 0x04e3bfdf);
	INSTANCE_WR(ctx, 0x2db68/4, 0x0001fe21);
	INSTANCE_WR(ctx, 0x2e5b0/4, 0x00000004);
	INSTANCE_WR(ctx, 0x2e5d0/4, 0x00000003);
	INSTANCE_WR(ctx, 0x2e810/4, 0x0000000f);
	INSTANCE_WR(ctx, 0x2e990/4, 0x00000004);
	INSTANCE_WR(ctx, 0x2e9b0/4, 0x0000ffff);
	INSTANCE_WR(ctx, 0x2e9d0/4, 0x0000ffff);
	INSTANCE_WR(ctx, 0x2e9f0/4, 0x0000ffff);
	INSTANCE_WR(ctx, 0x2ea10/4, 0x0000ffff);
	INSTANCE_WR(ctx, 0x2eb30/4, 0x00000001);
	INSTANCE_WR(ctx, 0x2ebb0/4, 0x00000001);
	INSTANCE_WR(ctx, 0x2ec70/4, 0x00000001);
	INSTANCE_WR(ctx, 0x2ee10/4, 0x00000001);
	INSTANCE_WR(ctx, 0x2ee30/4, 0x00000001);
	INSTANCE_WR(ctx, 0x2ee50/4, 0x00000002);
	INSTANCE_WR(ctx, 0x2ee70/4, 0x00000001);
	INSTANCE_WR(ctx, 0x2ee90/4, 0x00000001);
	INSTANCE_WR(ctx, 0x2eeb0/4, 0x00000002);
	INSTANCE_WR(ctx, 0x2eed0/4, 0x00000001);
	INSTANCE_WR(ctx, 0x2ef10/4, 0x00000011);
	INSTANCE_WR(ctx, 0x2f010/4, 0x0fac6881);
	INSTANCE_WR(ctx, 0x2f070/4, 0x00000004);
	INSTANCE_WR(ctx, 0x2f0f0/4, 0x00000011);
	INSTANCE_WR(ctx, 0x2f110/4, 0x00000001);
	INSTANCE_WR(ctx, 0x2f150/4, 0x000000cf);
	INSTANCE_WR(ctx, 0x2f170/4, 0x000000cf);
	INSTANCE_WR(ctx, 0x2f190/4, 0x000000cf);
	INSTANCE_WR(ctx, 0x2f2f0/4, 0x00000001);
	INSTANCE_WR(ctx, 0x2f310/4, 0x00000001);
	INSTANCE_WR(ctx, 0x2f330/4, 0x00000002);
	INSTANCE_WR(ctx, 0x2f350/4, 0x00000001);
	INSTANCE_WR(ctx, 0x2f370/4, 0x00000001);
	INSTANCE_WR(ctx, 0x2f390/4, 0x00000002);
	INSTANCE_WR(ctx, 0x2f3b0/4, 0x00000001);
	INSTANCE_WR(ctx, 0x2f3f0/4, 0x00000001);
	INSTANCE_WR(ctx, 0x2f410/4, 0x00000001);
	INSTANCE_WR(ctx, 0x2f430/4, 0x00000001);
	INSTANCE_WR(ctx, 0x2f450/4, 0x00000001);
	INSTANCE_WR(ctx, 0x2f470/4, 0x00000001);
	INSTANCE_WR(ctx, 0x2f490/4, 0x00000001);
	INSTANCE_WR(ctx, 0x2f4b0/4, 0x00000001);
	INSTANCE_WR(ctx, 0x2f4d0/4, 0x00000001);
	INSTANCE_WR(ctx, 0x2f4f0/4, 0x00000011);
	INSTANCE_WR(ctx, 0x2f5f0/4, 0x0fac6881);
	INSTANCE_WR(ctx, 0x2f610/4, 0x0000000f);
	INSTANCE_WR(ctx, 0x2f710/4, 0x001ffe67);
	INSTANCE_WR(ctx, 0x2f770/4, 0x00000011);
	INSTANCE_WR(ctx, 0x2f790/4, 0x00000001);
	INSTANCE_WR(ctx, 0x2f810/4, 0x00000004);
	INSTANCE_WR(ctx, 0x2f8d0/4, 0x00000001);
	INSTANCE_WR(ctx, 0x2f970/4, 0x00000011);
	INSTANCE_WR(ctx, 0x2fa70/4, 0x0fac6881);
	INSTANCE_WR(ctx, 0x2faf0/4, 0x00000011);
	INSTANCE_WR(ctx, 0x2fb10/4, 0x00000001);
	INSTANCE_WR(ctx, 0x2fb50/4, 0x00000001);
	INSTANCE_WR(ctx, 0x2fb90/4, 0x00000001);
	INSTANCE_WR(ctx, 0x2fbd0/4, 0x000007ff);
	INSTANCE_WR(ctx, 0x2fc10/4, 0x00000001);
	INSTANCE_WR(ctx, 0x2fc50/4, 0x00000001);
	INSTANCE_WR(ctx, 0x301b0/4, 0x00000008);
	INSTANCE_WR(ctx, 0x301d0/4, 0x00000008);
	INSTANCE_WR(ctx, 0x301f0/4, 0x00000008);
	INSTANCE_WR(ctx, 0x30210/4, 0x00000008);
	INSTANCE_WR(ctx, 0x30230/4, 0x00000008);
	INSTANCE_WR(ctx, 0x30250/4, 0x00000008);
	INSTANCE_WR(ctx, 0x30270/4, 0x00000008);
	INSTANCE_WR(ctx, 0x30290/4, 0x00000008);
	INSTANCE_WR(ctx, 0x302b0/4, 0x00000011);
	INSTANCE_WR(ctx, 0x303b0/4, 0x0fac6881);
	INSTANCE_WR(ctx, 0x303d0/4, 0x00000400);
	INSTANCE_WR(ctx, 0x303f0/4, 0x00000400);
	INSTANCE_WR(ctx, 0x30410/4, 0x00000400);
	INSTANCE_WR(ctx, 0x30430/4, 0x00000400);
	INSTANCE_WR(ctx, 0x30450/4, 0x00000400);
	INSTANCE_WR(ctx, 0x30470/4, 0x00000400);
	INSTANCE_WR(ctx, 0x30490/4, 0x00000400);
	INSTANCE_WR(ctx, 0x304b0/4, 0x00000400);
	INSTANCE_WR(ctx, 0x304d0/4, 0x00000300);
	INSTANCE_WR(ctx, 0x304f0/4, 0x00000300);
	INSTANCE_WR(ctx, 0x30510/4, 0x00000300);
	INSTANCE_WR(ctx, 0x30530/4, 0x00000300);
	INSTANCE_WR(ctx, 0x30550/4, 0x00000300);
	INSTANCE_WR(ctx, 0x30570/4, 0x00000300);
	INSTANCE_WR(ctx, 0x30590/4, 0x00000300);
	INSTANCE_WR(ctx, 0x305b0/4, 0x00000300);
	INSTANCE_WR(ctx, 0x305d0/4, 0x00000001);
	INSTANCE_WR(ctx, 0x305f0/4, 0x0000000f);
	INSTANCE_WR(ctx, 0x306f0/4, 0x00000020);
	INSTANCE_WR(ctx, 0x30710/4, 0x00000011);
	INSTANCE_WR(ctx, 0x30730/4, 0x00000100);
	INSTANCE_WR(ctx, 0x30770/4, 0x00000001);
	INSTANCE_WR(ctx, 0x307d0/4, 0x00000040);
	INSTANCE_WR(ctx, 0x307f0/4, 0x00000100);
	INSTANCE_WR(ctx, 0x30830/4, 0x00000003);
	INSTANCE_WR(ctx, 0x308d0/4, 0x001ffe67);
	INSTANCE_WR(ctx, 0x30950/4, 0x00000002);
	INSTANCE_WR(ctx, 0x30970/4, 0x0fac6881);
	INSTANCE_WR(ctx, 0x30ab0/4, 0x00000001);
	INSTANCE_WR(ctx, 0x30b50/4, 0x00000004);
	INSTANCE_WR(ctx, 0x30b90/4, 0x00000001);
	INSTANCE_WR(ctx, 0x30bb0/4, 0x00000400);
	INSTANCE_WR(ctx, 0x30bd0/4, 0x00000300);
	INSTANCE_WR(ctx, 0x30bf0/4, 0x00001001);
	INSTANCE_WR(ctx, 0x30c70/4, 0x00000011);
	INSTANCE_WR(ctx, 0x30d70/4, 0x0fac6881);
	INSTANCE_WR(ctx, 0x30d90/4, 0x0000000f);
	INSTANCE_WR(ctx, 0x31090/4, 0x001ffe67);
	INSTANCE_WR(ctx, 0x31110/4, 0x00000011);
	INSTANCE_WR(ctx, 0x31170/4, 0x00000004);
	INSTANCE_WR(ctx, 0x311b0/4, 0x00000001);
	INSTANCE_WR(ctx, 0x311d0/4, 0x00000001);
	INSTANCE_WR(ctx, 0x31250/4, 0x00000001);
	INSTANCE_WR(ctx, 0x312f0/4, 0x00000001);
	INSTANCE_WR(ctx, 0x31330/4, 0x00000001);
	INSTANCE_WR(ctx, 0x313b0/4, 0x2a712488);
	INSTANCE_WR(ctx, 0x313f0/4, 0x4085c000);
	INSTANCE_WR(ctx, 0x31410/4, 0x00000040);
	INSTANCE_WR(ctx, 0x31430/4, 0x00000100);
	INSTANCE_WR(ctx, 0x31450/4, 0x00010100);
	INSTANCE_WR(ctx, 0x31470/4, 0x02800000);
	INSTANCE_WR(ctx, 0x316d0/4, 0x04e3bfdf);
	INSTANCE_WR(ctx, 0x316f0/4, 0x04e3bfdf);
	INSTANCE_WR(ctx, 0x31710/4, 0x00000001);
	INSTANCE_WR(ctx, 0x31750/4, 0x00ffff00);
	INSTANCE_WR(ctx, 0x31770/4, 0x00000001);
	INSTANCE_WR(ctx, 0x317d0/4, 0x00ffff00);
	INSTANCE_WR(ctx, 0x318f0/4, 0x00000001);
	INSTANCE_WR(ctx, 0x31930/4, 0x00000001);
	INSTANCE_WR(ctx, 0x31950/4, 0x30201000);
	INSTANCE_WR(ctx, 0x31970/4, 0x70605040);
	INSTANCE_WR(ctx, 0x31990/4, 0xb8a89888);
	INSTANCE_WR(ctx, 0x319b0/4, 0xf8e8d8c8);
	INSTANCE_WR(ctx, 0x319f0/4, 0x0000001a);
	INSTANCE_WR(ctx, 0x4a7e0/4, 0x00000004);
	INSTANCE_WR(ctx, 0x4a800/4, 0x00000004);
	INSTANCE_WR(ctx, 0x4a820/4, 0x08100c12);
	INSTANCE_WR(ctx, 0x4a840/4, 0x00000003);
	INSTANCE_WR(ctx, 0x4a880/4, 0x08100c12);
	INSTANCE_WR(ctx, 0x4a8c0/4, 0x00080c14);
	INSTANCE_WR(ctx, 0x4a8e0/4, 0x00000001);
	INSTANCE_WR(ctx, 0x4a900/4, 0x00080c14);
	INSTANCE_WR(ctx, 0x4a960/4, 0x08100c12);
	INSTANCE_WR(ctx, 0x4a980/4, 0x00000027);
	INSTANCE_WR(ctx, 0x4a9e0/4, 0x00000001);
	INSTANCE_WR(ctx, 0x52220/4, 0x00000001);
	INSTANCE_WR(ctx, 0x52500/4, 0x08100c12);
	INSTANCE_WR(ctx, 0x526a0/4, 0x04000000);
	INSTANCE_WR(ctx, 0x526c0/4, 0x04000000);
	INSTANCE_WR(ctx, 0x52700/4, 0x00000080);
	INSTANCE_WR(ctx, 0x52780/4, 0x00000080);
	INSTANCE_WR(ctx, 0x527c0/4, 0x0000003f);
	INSTANCE_WR(ctx, 0x52920/4, 0x00000002);
	INSTANCE_WR(ctx, 0x52940/4, 0x04000000);
	INSTANCE_WR(ctx, 0x52960/4, 0x04000000);
	INSTANCE_WR(ctx, 0x52a80/4, 0x00000004);
	INSTANCE_WR(ctx, 0x52b00/4, 0x00000004);
	INSTANCE_WR(ctx, 0x52d40/4, 0x00000001);
	INSTANCE_WR(ctx, 0x52d60/4, 0x00001001);
	INSTANCE_WR(ctx, 0x52d80/4, 0x0000ffff);
	INSTANCE_WR(ctx, 0x52da0/4, 0x0000ffff);
	INSTANCE_WR(ctx, 0x52dc0/4, 0x0000ffff);
	INSTANCE_WR(ctx, 0x52de0/4, 0x0000ffff);
	INSTANCE_WR(ctx, 0x53200/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x53220/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x53240/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x53260/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x53280/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x532a0/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x532c0/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x532e0/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x53300/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x53320/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x53340/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x53360/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x53380/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x533a0/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x533c0/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x533e0/4, 0x3f800000);
	INSTANCE_WR(ctx, 0x53400/4, 0x00000010);
	INSTANCE_WR(ctx, 0x53460/4, 0x00000003);
	INSTANCE_WR(ctx, 0x53500/4, 0x08100c12);
	INSTANCE_WR(ctx, 0x53524/4, 0x00000080);
	INSTANCE_WR(ctx, 0x53540/4, 0x00000080);
	INSTANCE_WR(ctx, 0x53544/4, 0x80007004);
	INSTANCE_WR(ctx, 0x53560/4, 0x80007004);
	INSTANCE_WR(ctx, 0x53564/4, 0x04000400);
	INSTANCE_WR(ctx, 0x53580/4, 0x04000400);
	INSTANCE_WR(ctx, 0x53584/4, 0x00001000);
	INSTANCE_WR(ctx, 0x535a0/4, 0x00001000);
	INSTANCE_WR(ctx, 0x535e4/4, 0x00000001);
	INSTANCE_WR(ctx, 0x53600/4, 0x00000001);
	INSTANCE_WR(ctx, 0x53644/4, 0x00000001);
	INSTANCE_WR(ctx, 0x53660/4, 0x00000001);
	INSTANCE_WR(ctx, 0x53684/4, 0x00000004);
	INSTANCE_WR(ctx, 0x536a0/4, 0x00000004);
	INSTANCE_WR(ctx, 0x536a4/4, 0x00000002);
	INSTANCE_WR(ctx, 0x536c0/4, 0x00000002);
	INSTANCE_WR(ctx, 0x53824/4, 0x00000080);
	INSTANCE_WR(ctx, 0x53840/4, 0x00000080);
	INSTANCE_WR(ctx, 0x53844/4, 0x80007004);
	INSTANCE_WR(ctx, 0x53860/4, 0x80007004);
	INSTANCE_WR(ctx, 0x53864/4, 0x04000400);
	INSTANCE_WR(ctx, 0x53880/4, 0x04000400);
	INSTANCE_WR(ctx, 0x53884/4, 0x00001000);
	INSTANCE_WR(ctx, 0x538a0/4, 0x00001000);
	INSTANCE_WR(ctx, 0x538e4/4, 0x00000001);
	INSTANCE_WR(ctx, 0x53900/4, 0x00000001);
	INSTANCE_WR(ctx, 0x53944/4, 0x00000001);
	INSTANCE_WR(ctx, 0x53960/4, 0x00000001);
	INSTANCE_WR(ctx, 0x53984/4, 0x00000004);
	INSTANCE_WR(ctx, 0x539a0/4, 0x00000004);
	INSTANCE_WR(ctx, 0x539a4/4, 0x00000002);
	INSTANCE_WR(ctx, 0x539c0/4, 0x00000002);
	INSTANCE_WR(ctx, 0x53b04/4, 0x08100c12);
	INSTANCE_WR(ctx, 0x53b20/4, 0x08100c12);
	INSTANCE_WR(ctx, 0x53be4/4, 0x0000ffff);
	INSTANCE_WR(ctx, 0x53c00/4, 0x0000ffff);
	INSTANCE_WR(ctx, 0x53c04/4, 0x0000ffff);
	INSTANCE_WR(ctx, 0x53c20/4, 0x0000ffff);
	INSTANCE_WR(ctx, 0x53c24/4, 0x0000ffff);
	INSTANCE_WR(ctx, 0x53c40/4, 0x0000ffff);
	INSTANCE_WR(ctx, 0x53c44/4, 0x0000ffff);
	INSTANCE_WR(ctx, 0x53c60/4, 0x0000ffff);
	INSTANCE_WR(ctx, 0x53c64/4, 0x00000001);
	INSTANCE_WR(ctx, 0x53c80/4, 0x00000001);
	INSTANCE_WR(ctx, 0x53c84/4, 0x00010001);
	INSTANCE_WR(ctx, 0x53ca0/4, 0x00010001);
	INSTANCE_WR(ctx, 0x53ca4/4, 0x00010001);
	INSTANCE_WR(ctx, 0x53cc0/4, 0x00010001);
	INSTANCE_WR(ctx, 0x53cc4/4, 0x00000001);
	INSTANCE_WR(ctx, 0x53ce0/4, 0x00000001);
	INSTANCE_WR(ctx, 0x53d04/4, 0x0001fe21);
	INSTANCE_WR(ctx, 0x53d20/4, 0x0001fe21);
	INSTANCE_WR(ctx, 0x53dc4/4, 0x08100c12);
	INSTANCE_WR(ctx, 0x53de0/4, 0x08100c12);
	INSTANCE_WR(ctx, 0x53de4/4, 0x00000004);
	INSTANCE_WR(ctx, 0x53e00/4, 0x00000004);
	INSTANCE_WR(ctx, 0x53e24/4, 0x00000002);
	INSTANCE_WR(ctx, 0x53e40/4, 0x00000002);
	INSTANCE_WR(ctx, 0x53e44/4, 0x00000011);
	INSTANCE_WR(ctx, 0x53e60/4, 0x00000011);
	INSTANCE_WR(ctx, 0x53f64/4, 0x0fac6881);
	INSTANCE_WR(ctx, 0x53f80/4, 0x0fac6881);
	INSTANCE_WR(ctx, 0x54004/4, 0x00000004);
	INSTANCE_WR(ctx, 0x54020/4, 0x00000004);
	INSTANCE_WR(ctx, 0x54144/4, 0x00000002);
	INSTANCE_WR(ctx, 0x54160/4, 0x00000002);
	INSTANCE_WR(ctx, 0x54164/4, 0x00000001);
	INSTANCE_WR(ctx, 0x54180/4, 0x00000001);
	INSTANCE_WR(ctx, 0x54184/4, 0x00000001);
	INSTANCE_WR(ctx, 0x541a0/4, 0x00000001);
	INSTANCE_WR(ctx, 0x541a4/4, 0x00000002);
	INSTANCE_WR(ctx, 0x541c0/4, 0x00000002);
	INSTANCE_WR(ctx, 0x541c4/4, 0x00000001);
	INSTANCE_WR(ctx, 0x541e0/4, 0x00000001);
	INSTANCE_WR(ctx, 0x541e4/4, 0x00000001);
	INSTANCE_WR(ctx, 0x54200/4, 0x00000001);
	INSTANCE_WR(ctx, 0x54204/4, 0x00000001);
	INSTANCE_WR(ctx, 0x54220/4, 0x00000001);
	INSTANCE_WR(ctx, 0x54244/4, 0x00000004);
	INSTANCE_WR(ctx, 0x54260/4, 0x00000004);
	INSTANCE_WR(ctx, 0x5b6a4/4, 0x00000011);
	INSTANCE_WR(ctx, 0x5b6c0/4, 0x00000011);
	INSTANCE_WR(ctx, 0x5b6e4/4, 0x00000001);
	INSTANCE_WR(ctx, 0x5b700/4, 0x00000001);
}

int
nv50_graph_create_context(struct nouveau_channel *chan)
{
	struct drm_device *dev = chan->dev;
	struct drm_nouveau_private *dev_priv = dev->dev_private;
	struct nouveau_gpuobj *ramin = chan->ramin->gpuobj;
	struct nouveau_engine *engine = &dev_priv->Engine;
	int grctx_size = 0x60000, hdr;
	int ret;

	DRM_DEBUG("ch%d\n", chan->id);

	ret = nouveau_gpuobj_new_ref(dev, chan, NULL, 0, grctx_size, 0x1000,
				     NVOBJ_FLAG_ZERO_ALLOC |
				     NVOBJ_FLAG_ZERO_FREE, &chan->ramin_grctx);
	if (ret)
		return ret;

	hdr = IS_G80 ? 0x200 : 0x20;
	INSTANCE_WR(ramin, (hdr + 0x00)/4, 0x00190002);
	INSTANCE_WR(ramin, (hdr + 0x04)/4, chan->ramin_grctx->instance +
					   grctx_size - 1);
	INSTANCE_WR(ramin, (hdr + 0x08)/4, chan->ramin_grctx->instance);
	INSTANCE_WR(ramin, (hdr + 0x0c)/4, 0);
	INSTANCE_WR(ramin, (hdr + 0x10)/4, 0);
	INSTANCE_WR(ramin, (hdr + 0x14)/4, 0x00010000);

	INSTANCE_WR(chan->ramin_grctx->gpuobj, 0x00000/4,
		    chan->ramin->instance >> 12);
	INSTANCE_WR(chan->ramin_grctx->gpuobj, 0x0011c/4, 0x00000002);

	switch (dev_priv->chipset) {
	case 0x84:
		nv84_graph_init_ctxvals(dev, chan->ramin_grctx);
		break;
	case 0x86:
		nv86_graph_init_ctxvals(dev, chan->ramin_grctx);
		break;
	default:
		/* This is complete crack, it accidently used to make at
		 * least some G8x cards work partially somehow, though there's
		 * no good reason why - and it stopped working as the rest
		 * of the code got off the drugs..
		 */
		ret = engine->graph.load_context(chan);
		if (ret) {
			DRM_ERROR("Error hacking up context: %d\n", ret);
			return ret;
		}
		break;
	}

	return 0;
}

void
nv50_graph_destroy_context(struct nouveau_channel *chan)
{
	struct drm_device *dev = chan->dev;
	struct drm_nouveau_private *dev_priv = dev->dev_private;
	int i, hdr;

	DRM_DEBUG("ch%d\n", chan->id);

	hdr = IS_G80 ? 0x200 : 0x20;
	for (i=hdr; i<hdr+24; i+=4)
		INSTANCE_WR(chan->ramin->gpuobj, i/4, 0);

	nouveau_gpuobj_ref_del(dev, &chan->ramin_grctx);
}

static int
nv50_graph_transfer_context(struct drm_device *dev, uint32_t inst, int save)
{
	struct drm_nouveau_private *dev_priv = dev->dev_private;
	uint32_t old_cp, tv = 20000;
	int i;

	DRM_DEBUG("inst=0x%08x, save=%d\n", inst, save);

	old_cp = NV_READ(NV20_PGRAPH_CHANNEL_CTX_POINTER);
	NV_WRITE(NV20_PGRAPH_CHANNEL_CTX_POINTER, inst);
	NV_WRITE(0x400824, NV_READ(0x400824) |
		 (save ? NV40_PGRAPH_CTXCTL_0310_XFER_SAVE :
			 NV40_PGRAPH_CTXCTL_0310_XFER_LOAD));
	NV_WRITE(NV40_PGRAPH_CTXCTL_0304, NV40_PGRAPH_CTXCTL_0304_XFER_CTX);

	for (i = 0; i < tv; i++) {
		if (NV_READ(NV40_PGRAPH_CTXCTL_030C) == 0)
			break;
	}
	NV_WRITE(NV20_PGRAPH_CHANNEL_CTX_POINTER, old_cp);

	if (i == tv) {
		DRM_ERROR("failed: inst=0x%08x save=%d\n", inst, save);
		DRM_ERROR("0x40030C = 0x%08x\n",
			  NV_READ(NV40_PGRAPH_CTXCTL_030C));
		return -EBUSY;
	}

	return 0;
}

int
nv50_graph_load_context(struct nouveau_channel *chan)
{
	struct drm_device *dev = chan->dev;
	struct drm_nouveau_private *dev_priv = dev->dev_private;
	uint32_t inst = chan->ramin->instance >> 12;
	int ret; (void)ret;

	DRM_DEBUG("ch%d\n", chan->id);

#if 0
	if ((ret = nv50_graph_transfer_context(dev, inst, 0)))
		return ret;
#endif

	NV_WRITE(NV20_PGRAPH_CHANNEL_CTX_POINTER, inst);
	NV_WRITE(0x400320, 4);
	NV_WRITE(NV40_PGRAPH_CTXCTL_CUR, inst | (1<<31));

	return 0;
}

int
nv50_graph_save_context(struct nouveau_channel *chan)
{
	struct drm_device *dev = chan->dev;
	uint32_t inst = chan->ramin->instance >> 12;

	DRM_DEBUG("ch%d\n", chan->id);

	return nv50_graph_transfer_context(dev, inst, 1);
}