/* * Copyright 2013 Red Hat Inc. * * 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 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 HOLDER(S) OR AUTHOR(S) 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. * * Authors: Ben Skeggs
*/ #include"ramnv40.h"
/* change the PLL of each memory partition */
nvkm_mask(device, 0x00c040, 0x0000c000, 0x00000000); switch (device->chipset) { case 0x40: case 0x45: case 0x41: case 0x42: case 0x47:
nvkm_mask(device, 0x004044, 0xc0771100, ram->ctrl);
nvkm_mask(device, 0x00402c, 0xc0771100, ram->ctrl);
nvkm_wr32(device, 0x004048, ram->coef);
nvkm_wr32(device, 0x004030, ram->coef);
fallthrough; case 0x43: case 0x49: case 0x4b:
nvkm_mask(device, 0x004038, 0xc0771100, ram->ctrl);
nvkm_wr32(device, 0x00403c, ram->coef);
fallthrough; default:
nvkm_mask(device, 0x004020, 0xc0771100, ram->ctrl);
nvkm_wr32(device, 0x004024, ram->coef); break;
}
udelay(100);
nvkm_mask(device, 0x00c040, 0x0000c000, 0x0000c000);
/* re-enable normal operation of memory controller */
nvkm_wr32(device, 0x1002dc, 0x00000000);
nvkm_mask(device, 0x100210, 0x80000000, 0x80000000);
udelay(100);
/* execute memory reset script from vbios */ if (!bit_entry(bios, 'M', &M))
nvbios_init(subdev, nvbios_rd16(bios, M.offset + 0x00));
/* make sure we're in vblank (hopefully the same one as before), and * then re-enable crtc memory access
*/ for (i = 0; i < 2; i++) { if (!(crtc_mask & (1 << i))) continue;
nvkm_msec(device, 2000,
u32 tmp = nvkm_rd32(device, 0x600808 + (i * 0x2000)); if ( (tmp & 0x00010000)) break;
);
nvkm_wr08(device, 0x0c03c4 + (i * 0x2000), 0x01);
nvkm_wr08(device, 0x0c03c5 + (i * 0x2000), sr1[i]);
}
switch (pbus1218 & 0x00000300) { case 0x00000000: type = NVKM_RAM_TYPE_SDRAM; break; case 0x00000100: type = NVKM_RAM_TYPE_DDR1 ; break; case 0x00000200: type = NVKM_RAM_TYPE_GDDR3; break; case 0x00000300: type = NVKM_RAM_TYPE_DDR2 ; break;
}
ret = nv40_ram_new_(fb, type, size, pram); if (ret) return ret;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.