restructured startup code, tested NV34 coldstart as secondary card: we have a go!. Analog monitors only, rest is working nicely. 8-). The script exec code is not yet finished, so I cannot promiss (yet) every card actually starts up. WoeHoe!
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9074 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -80,7 +80,7 @@ status_t nv_general_powerup()
|
|||||||
{
|
{
|
||||||
status_t status;
|
status_t status;
|
||||||
|
|
||||||
LOG(1,("POWERUP: nVidia (open)BeOS Accelerant 0.27 running.\n"));
|
LOG(1,("POWERUP: nVidia (open)BeOS Accelerant 0.28 running.\n"));
|
||||||
|
|
||||||
/* preset no laptop */
|
/* preset no laptop */
|
||||||
si->ps.laptop = false;
|
si->ps.laptop = false;
|
||||||
@@ -899,9 +899,13 @@ static status_t nvxx_general_powerup()
|
|||||||
{
|
{
|
||||||
LOG(4, ("INIT: NV powerup\n"));
|
LOG(4, ("INIT: NV powerup\n"));
|
||||||
|
|
||||||
/* fill-in the cardspecs in the shared_info PINS struct */
|
/* setup cardspecs */
|
||||||
fake_pins();
|
/* note:
|
||||||
/* only process BIOS for specs and coldstart if requested by user;
|
* this MUST be done before the driver attempts a card coldstart */
|
||||||
|
set_specs();
|
||||||
|
|
||||||
|
/* only process BIOS for finetuning specs and coldstarting card if requested
|
||||||
|
* by the user;
|
||||||
* note:
|
* note:
|
||||||
* this in fact frees the driver from relying on the BIOS to be executed
|
* this in fact frees the driver from relying on the BIOS to be executed
|
||||||
* at system power-up POST time. */
|
* at system power-up POST time. */
|
||||||
@@ -918,13 +922,16 @@ static status_t nvxx_general_powerup()
|
|||||||
LOG(2, ("INIT: Skipping card coldstart!\n"));
|
LOG(2, ("INIT: Skipping card coldstart!\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* get RAM size and fake panel startup (panel init code is still missing) */
|
||||||
|
fake_panel_start();
|
||||||
|
|
||||||
|
/* log the final card specifications */
|
||||||
|
dump_pins();
|
||||||
|
|
||||||
/* dump config space as it is after a possible coldstart attempt */
|
/* dump config space as it is after a possible coldstart attempt */
|
||||||
if (si->settings.logmask & 0x80000000) nv_dump_configuration_space();
|
if (si->settings.logmask & 0x80000000) nv_dump_configuration_space();
|
||||||
|
|
||||||
/* log the final PINS struct settings */
|
/* setup CRTC and DAC functions access: determined in fake_panel_start */
|
||||||
dump_pins();
|
|
||||||
|
|
||||||
/* setup CRTC and DAC functions access: determined in fake_pins */
|
|
||||||
setup_virtualized_heads(si->ps.crtc2_prim);
|
setup_virtualized_heads(si->ps.crtc2_prim);
|
||||||
|
|
||||||
/* do powerup needed from pre-inited card state as done by system POST cardBIOS
|
/* do powerup needed from pre-inited card state as done by system POST cardBIOS
|
||||||
|
|||||||
@@ -27,7 +27,9 @@ static void pinsnv6_fake(void);
|
|||||||
static void pinsnv10_arch_fake(void);
|
static void pinsnv10_arch_fake(void);
|
||||||
static void pinsnv20_arch_fake(void);
|
static void pinsnv20_arch_fake(void);
|
||||||
static void pinsnv30_arch_fake(void);
|
static void pinsnv30_arch_fake(void);
|
||||||
|
static void getRAMsize_arch_nv4(void);
|
||||||
static void getstrap_arch_nv4(void);
|
static void getstrap_arch_nv4(void);
|
||||||
|
static void getRAMsize_arch_nv10_20_30_40(void);
|
||||||
static void getstrap_arch_nv10_20_30_40(void);
|
static void getstrap_arch_nv10_20_30_40(void);
|
||||||
static status_t pins2_read(uint8 *rom, uint32 offset);
|
static status_t pins2_read(uint8 *rom, uint32 offset);
|
||||||
static status_t pins3_5_read(uint8 *rom, uint32 offset);
|
static status_t pins3_5_read(uint8 *rom, uint32 offset);
|
||||||
@@ -188,7 +190,6 @@ static status_t pins3_5_read(uint8 *rom, uint32 offset)
|
|||||||
//si->ps.max_video_vco = fvco_max / 1000;
|
//si->ps.max_video_vco = fvco_max / 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
//fixme: extract RAM and core speeds from startscripts..
|
|
||||||
//fixme: add 'parsing scripts while not actually executing' as warmstart method,
|
//fixme: add 'parsing scripts while not actually executing' as warmstart method,
|
||||||
// instead of not parsing at all: this will update the driver's speeds
|
// instead of not parsing at all: this will update the driver's speeds
|
||||||
// as below, while logging the scripts as well (for our learning pleasure :)
|
// as below, while logging the scripts as well (for our learning pleasure :)
|
||||||
@@ -224,7 +225,7 @@ static status_t coldstart_card(uint8* rom, uint16 init1, uint16 init2, uint16 in
|
|||||||
status_t result = B_OK;
|
status_t result = B_OK;
|
||||||
int16 size = init_size;
|
int16 size = init_size;
|
||||||
|
|
||||||
LOG(8,("INFO: executing coldstart...\n"));
|
LOG(8,("INFO: now executing coldstart...\n"));
|
||||||
|
|
||||||
/* select colormode CRTC registers base adresses */
|
/* select colormode CRTC registers base adresses */
|
||||||
NV_REG8(NV8_MISCW) = 0xcb;
|
NV_REG8(NV8_MISCW) = 0xcb;
|
||||||
@@ -292,7 +293,7 @@ static status_t coldstart_card_516_up(uint8* rom, PinsTables tabs, uint16 ram_ta
|
|||||||
status_t result = B_OK;
|
status_t result = B_OK;
|
||||||
uint16 adress;
|
uint16 adress;
|
||||||
|
|
||||||
LOG(8,("INFO: executing coldstart...\n"));
|
LOG(8,("INFO: now executing coldstart...\n"));
|
||||||
|
|
||||||
/* select colormode CRTC registers base adresses */
|
/* select colormode CRTC registers base adresses */
|
||||||
NV_REG8(NV8_MISCW) = 0xcb;
|
NV_REG8(NV8_MISCW) = 0xcb;
|
||||||
@@ -1683,10 +1684,10 @@ static status_t nv_crtc_setup_fifo()
|
|||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* fake_pins presumes the card was coldstarted by it's BIOS */
|
/* (pre)set 'fixed' card specifications */
|
||||||
void fake_pins(void)
|
void set_specs(void)
|
||||||
{
|
{
|
||||||
LOG(8,("INFO: faking PINS\n"));
|
LOG(8,("INFO: setting up card specifications\n"));
|
||||||
|
|
||||||
/* set failsave speeds */
|
/* set failsave speeds */
|
||||||
switch (si->ps.card_type)
|
switch (si->ps.card_type)
|
||||||
@@ -1722,7 +1723,7 @@ void fake_pins(void)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* detect RAM amount, reference crystal frequency and dualhead */
|
/* detect reference crystal frequency and dualhead */
|
||||||
switch (si->ps.card_arch)
|
switch (si->ps.card_arch)
|
||||||
{
|
{
|
||||||
case NV04A:
|
case NV04A:
|
||||||
@@ -1732,6 +1733,23 @@ void fake_pins(void)
|
|||||||
getstrap_arch_nv10_20_30_40();
|
getstrap_arch_nv10_20_30_40();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* this routine presumes the card was coldstarted by the card's BIOS for panel stuff */
|
||||||
|
void fake_panel_start(void)
|
||||||
|
{
|
||||||
|
LOG(8,("INFO: detecting RAM size\n"));
|
||||||
|
|
||||||
|
/* detect RAM amount */
|
||||||
|
switch (si->ps.card_arch)
|
||||||
|
{
|
||||||
|
case NV04A:
|
||||||
|
getRAMsize_arch_nv4();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
getRAMsize_arch_nv10_20_30_40();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/* override memory detection if requested by user */
|
/* override memory detection if requested by user */
|
||||||
if (si->settings.memory != 0)
|
if (si->settings.memory != 0)
|
||||||
@@ -1752,6 +1770,8 @@ void fake_pins(void)
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
LOG(8,("INFO: faking panel startup\n"));
|
||||||
|
|
||||||
/* find out the BIOS preprogrammed panel use status... */
|
/* find out the BIOS preprogrammed panel use status... */
|
||||||
detect_panels();
|
detect_panels();
|
||||||
|
|
||||||
@@ -2532,7 +2552,7 @@ static void pinsnv30_arch_fake(void)
|
|||||||
si->ps.std_memory_clock = 190;
|
si->ps.std_memory_clock = 190;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void getstrap_arch_nv4(void)
|
static void getRAMsize_arch_nv4(void)
|
||||||
{
|
{
|
||||||
uint32 strapinfo = NV_REG32(NV32_NV4STRAPINFO);
|
uint32 strapinfo = NV_REG32(NV32_NV4STRAPINFO);
|
||||||
|
|
||||||
@@ -2563,8 +2583,11 @@ static void getstrap_arch_nv4(void)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
strapinfo = NV_REG32(NV32_NVSTRAPINFO2);
|
static void getstrap_arch_nv4(void)
|
||||||
|
{
|
||||||
|
uint32 strapinfo = NV_REG32(NV32_NVSTRAPINFO2);
|
||||||
|
|
||||||
/* determine PLL reference crystal frequency */
|
/* determine PLL reference crystal frequency */
|
||||||
if (strapinfo & 0x00000040)
|
if (strapinfo & 0x00000040)
|
||||||
@@ -2576,7 +2599,7 @@ static void getstrap_arch_nv4(void)
|
|||||||
si->ps.secondary_head = false;
|
si->ps.secondary_head = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void getstrap_arch_nv10_20_30_40(void)
|
static void getRAMsize_arch_nv10_20_30_40(void)
|
||||||
{
|
{
|
||||||
uint32 dev_manID = CFGR(DEVID);
|
uint32 dev_manID = CFGR(DEVID);
|
||||||
uint32 strapinfo = NV_REG32(NV32_NV10STRAPINFO);
|
uint32 strapinfo = NV_REG32(NV32_NV10STRAPINFO);
|
||||||
@@ -2626,8 +2649,12 @@ static void getstrap_arch_nv10_20_30_40(void)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
strapinfo = NV_REG32(NV32_NVSTRAPINFO2);
|
static void getstrap_arch_nv10_20_30_40(void)
|
||||||
|
{
|
||||||
|
uint32 dev_manID = CFGR(DEVID);
|
||||||
|
uint32 strapinfo = NV_REG32(NV32_NVSTRAPINFO2);
|
||||||
|
|
||||||
/* determine PLL reference crystal frequency: three types are used... */
|
/* determine PLL reference crystal frequency: three types are used... */
|
||||||
if (strapinfo & 0x00000040)
|
if (strapinfo & 0x00000040)
|
||||||
|
|||||||
@@ -34,7 +34,8 @@ status_t i2c_maven_probe(void);
|
|||||||
/* card info functions */
|
/* card info functions */
|
||||||
status_t parse_pins(void);
|
status_t parse_pins(void);
|
||||||
void get_panel_modes(display_mode *p1, display_mode *p2, bool *pan1, bool *pan2);
|
void get_panel_modes(display_mode *p1, display_mode *p2, bool *pan1, bool *pan2);
|
||||||
void fake_pins(void);
|
void fake_panel_start(void);
|
||||||
|
void set_specs(void);
|
||||||
void dump_pins(void);
|
void dump_pins(void);
|
||||||
|
|
||||||
/* DAC functions */
|
/* DAC functions */
|
||||||
|
|||||||
Reference in New Issue
Block a user