38 static const u8 types[256] = {
39 1, 1, 3, 3, 3, 3, 0, 3, 3, 3, 3, 0, 0, 0, 0, 0,
40 0, 1, 0, 0, 0, 0, 0, 3, 3, 3, 3, 0, 0, 0, 0, 0,
41 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
42 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3,
43 3, 3, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
44 0, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
45 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
46 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
47 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 0, 1, 1, 1, 1, 0,
48 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
49 0, 0, 0, 3, 3, 3, 3, 1, 1, 1, 1, 0, 0, 0, 0, 0,
50 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,
51 3, 3, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3,
52 3, 3, 0, 0, 0, 0, 0, 0, 3, 0, 0, 3, 0, 3, 0, 3,
53 3, 0, 3, 3, 3, 3, 3, 0, 0, 3, 0, 3, 0, 3, 3, 0,
54 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 1, 1, 0
60 u8 memtype = (tile_flags & 0x0000ff00) >> 8;
61 return likely((types[memtype] == 1));
71 int type = (memtype & 0x0ff);
72 int back = (memtype & 0x800);
97 pfb->
ram.put(pfb, &mem);
122 nv_wr32(priv, 0x100c10, priv->
r100c10 >> 8);
146 const u32 rsvd_head = ( 256 * 1024) >> 12;
147 const u32 rsvd_tail = (1024 * 1024) >> 12;
148 u32 parts = nv_rd32(priv, 0x022438);
149 u32 pmask = nv_rd32(priv, 0x022554);
150 u32 bsize = nv_rd32(priv, 0x10f20c);
155 nv_debug(priv,
"0x100800: 0x%08x\n", nv_rd32(priv, 0x100800));
156 nv_debug(priv,
"parts 0x%08x mask 0x%08x\n", parts, pmask);
159 priv->
base.ram.ranks = (nv_rd32(priv, 0x10f200) & 0x00000004) ? 2 : 1;
162 for (part = 0; part < parts; part++) {
163 if (!(pmask & (1 << part))) {
164 u32 psize = nv_rd32(priv, 0x11020c + (part * 0x1000));
165 if (psize != bsize) {
171 nv_debug(priv,
"%d: mem_amount 0x%08x\n", part, psize);
172 priv->
base.ram.size += (
u64)psize << 20;
179 length = (priv->
base.ram.size >> 12) - rsvd_head - rsvd_tail;
189 offset = (0x0200000000ULL >> 12) + (bsize << 8);
190 length = (priv->
base.ram.size >> 12) - (bsize << 8) - rsvd_tail;
211 *pobject = nv_object(priv);
215 priv->
base.memtype_valid = nvc0_fb_memtype_valid;
216 priv->
base.ram.get = nvc0_fb_vram_new;
219 ret = nvc0_vram_detect(priv);
229 if (pci_dma_mapping_error(device->
pdev, priv->
r100c10))
240 .ctor = nvc0_fb_ctor,
241 .dtor = nvc0_fb_dtor,
242 .init = nvc0_fb_init,