Chameleon

Chameleon Svn Source Tree

Root/branches/cparm/i386/modules/GraphicsEnabler/nvidia.h

1/*
2 * NVidia injector
3 *
4 * Copyright (C) 2009 Jasmin Fazlic, iNDi
5 *
6 * NVidia injector is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * NVidia driver and injector is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with NVidia injector. If not, see <http://www.gnu.org/licenses/>.
18 */
19 /*
20 * Alternatively you can choose to comply with APSL
21 */
22
23/*
24 * DCB-Table parsing is based on software (nouveau driver) originally distributed under following license:
25 *
26 *
27 * Copyright 2005-2006 Erik Waling
28 * Copyright 2006 Stephane Marchesin
29 * Copyright 2007-2009 Stuart Bennett
30 *
31 * Permission is hereby granted, free of charge, to any person obtaining a
32 * copy of this software and associated documentation files (the "Software"),
33 * to deal in the Software without restriction, including without limitation
34 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
35 * and/or sell copies of the Software, and to permit persons to whom the
36 * Software is furnished to do so, subject to the following conditions:
37 *
38 * The above copyright notice and this permission notice shall be included in
39 * all copies or substantial portions of the Software.
40 *
41 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
42 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
43 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
44 * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
45 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
46 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
47 * SOFTWARE.
48 */
49
50#ifndef __LIBSAIO_NVIDIA_H
51#define __LIBSAIO_NVIDIA_H
52
53#define kUseNvidiaROM"UseNvidiaROM"/* nvidia.c */
54#define kVBIOS"VBIOS"/* nvidia.c */
55#define kDcfg0 "display_0" /* nvidia.c */
56#define kDcfg1 "display_1" /* nvidia.c */
57#define kEnableHDMIAudio "EnableHDMIAudio" /* nvidia.c */
58
59bool setup_nvidia_devprop(pci_dt_t *nvda_dev);
60
61struct nv_chipsets_t {
62unsigned device;
63char *name;
64};
65
66#define DCB_MAX_NUM_ENTRIES 16
67#define DCB_MAX_NUM_I2C_ENTRIES 16
68
69#define DCB_LOC_ON_CHIP 0
70
71struct bios {
72uint16_tsignature;/* 0x55AA */
73uint8_tsize;/* Size in multiples of 512 */
74};
75
76#define NV_PROM_OFFSET0x300000
77#define NV_PROM_SIZE0x0000ffff
78#define NV_PRAMIN_OFFSET0x00700000
79#define NV_PRAMIN_SIZE0x00100000
80#define NV04_PFB_FIFO_DATA0x0010020c
81#define NV10_PFB_FIFO_DATA_RAM_AMOUNT_MB_MASK0xfff00000
82#define NV10_PFB_FIFO_DATA_RAM_AMOUNT_MB_SHIFT20
83#define NVC0_MEM_CTRLR_COUNT0x00121c74
84#define NVC0_MEM_CTRLR_RAM_AMOUNT0x0010f20c
85
86#define NV_PBUS_PCI_NV_200x00001850
87#define NV_PBUS_PCI_NV_20_ROM_SHADOW_DISABLED(0 << 0)
88#define NV_PBUS_PCI_NV_20_ROM_SHADOW_ENABLED(1 << 0)
89
90#define REG8(reg) ((volatile uint8_t *)regs)[(reg)]
91#define REG16(reg) ((volatile uint16_t *)regs)[(reg) >> 1]
92#define REG32(reg) ((volatile uint32_t *)regs)[(reg) >> 2]
93
94#define NV_ARCH_03 0x03
95#define NV_ARCH_04 0x04
96#define NV_ARCH_10 0x10
97#define NV_ARCH_20 0x20
98#define NV_ARCH_30 0x30
99#define NV_ARCH_40 0x40
100#define NV_ARCH_50 0x50
101#define NV_ARCH_C0 0xC0
102
103#define CHIPSET_NV03 0x0010
104#define CHIPSET_NV04 0x0020
105#define CHIPSET_NV10 0x0100
106#define CHIPSET_NV11 0x0110
107#define CHIPSET_NV15 0x0150
108#define CHIPSET_NV17 0x0170
109#define CHIPSET_NV18 0x0180
110#define CHIPSET_NFORCE 0x01A0
111#define CHIPSET_NFORCE2 0x01F0
112#define CHIPSET_NV20 0x0200
113#define CHIPSET_NV25 0x0250
114#define CHIPSET_NV28 0x0280
115#define CHIPSET_NV30 0x0300
116#define CHIPSET_NV31 0x0310
117#define CHIPSET_NV34 0x0320
118#define CHIPSET_NV35 0x0330
119#define CHIPSET_NV36 0x0340
120#define CHIPSET_NV40 0x0040
121#define CHIPSET_NV41 0x00C0
122#define CHIPSET_NV43 0x0140
123#define CHIPSET_NV44 0x0160
124#define CHIPSET_NV44A 0x0220
125#define CHIPSET_NV45 0x0210
126#define CHIPSET_NV50 0x0190
127#define CHIPSET_NV84 0x0400
128#define CHIPSET_MISC_BRIDGED 0x00F0
129#define CHIPSET_G70 0x0090
130#define CHIPSET_G71 0x0290
131#define CHIPSET_G72 0x01D0
132#define CHIPSET_G73 0x0390
133
134// integrated GeForces (6100, 6150)
135#define CHIPSET_C51 0x0240
136
137// variant of C51, seems based on a G70 design
138#define CHIPSET_C512 0x03D0
139#define CHIPSET_G73_BRIDGED 0x02E0
140
141#endif /* !__LIBSAIO_NVIDIA_H */
142

Archive Download this file

Revision: 2122