* Matrox X-Server Startup
@ 1997-06-20 9:06 Michael B. Schmitz
0 siblings, 0 replies; 2+ messages in thread
From: Michael B. Schmitz @ 1997-06-20 9:06 UTC (permalink / raw)
The following function comes from the XFree86-3.3 source code. I have
a Matrox millenium which fails to work with the X server. The server loops
forever at the lines marked with an 'X' below. Again, I am puzzled. Could
this have anything to do with the preceding message?
mbs@veritas.com
415 335 8452
/*
* MGATi3026SetMCLK - Set the memory clock (MCLK) PLL.
*
* HISTORY
* January 11, 1997 - [aem] Andrew E. Mileski
* Written and tested.
*/
static void
MGATi3026SetMCLK( f_out )
long f_out;
{
double f_pll;
int mclk_m, mclk_n, mclk_p;
int pclk_m, pclk_n, pclk_p;
int mclk_ctl, rfhcnt;
f_pll = MGATi3026CalcClock(
f_out, TI_MAX_MCLK_FREQ,
& mclk_m, & mclk_n, & mclk_p
);
/* Save PCLK settings */
outTi3026( TVP3026_PLL_ADDR, 0, 0xfc );
pclk_n = inTi3026( TVP3026_PIX_CLK_DATA );
outTi3026( TVP3026_PLL_ADDR, 0, 0xfd );
pclk_m = inTi3026( TVP3026_PIX_CLK_DATA );
outTi3026( TVP3026_PLL_ADDR, 0, 0xfe );
pclk_p = inTi3026( TVP3026_PIX_CLK_DATA );
/* Stop PCLK (PLLEN = 0, PCLKEN = 0) */
outTi3026( TVP3026_PLL_ADDR, 0, 0xfe );
outTi3026( TVP3026_PIX_CLK_DATA, 0, 0x00 );
/* Set PCLK to the new MCLK frequency (PLLEN = 1, PCLKEN = 0 ) */
outTi3026( TVP3026_PLL_ADDR, 0, 0xfc );
outTi3026( TVP3026_PIX_CLK_DATA, 0, ( mclk_n & 0x3f ) | 0xc0 );
outTi3026( TVP3026_PIX_CLK_DATA, 0, mclk_m & 0x3f );
outTi3026( TVP3026_PIX_CLK_DATA, 0, ( mclk_p & 0x03 ) | 0xb0 );
/* Loop here forever -- mbs */
/* Wait for PCLK PLL to lock on frequency */
X while (( inTi3026( TVP3026_PIX_CLK_DATA ) & 0x40 ) == 0 ) {
X ;
X }
/* Output PCLK on MCLK pin */
mclk_ctl = inTi3026( TVP3026_MCLK_CTL );
outTi3026( TVP3026_MCLK_CTL, 0, mclk_ctl & 0xe7 );
outTi3026( TVP3026_MCLK_CTL, 0, ( mclk_ctl & 0xe7 ) | 0x08 );
/* Stop MCLK (PLLEN = 0 ) */
outTi3026( TVP3026_PLL_ADDR, 0, 0xfb );
outTi3026( TVP3026_MEM_CLK_DATA, 0, 0x00 );
/* Set MCLK to the new frequency (PLLEN = 1) */
outTi3026( TVP3026_PLL_ADDR, 0, 0xf3 );
outTi3026( TVP3026_MEM_CLK_DATA, 0, ( mclk_n & 0x3f ) | 0xc0 );
outTi3026( TVP3026_MEM_CLK_DATA, 0, mclk_m & 0x3f );
outTi3026( TVP3026_MEM_CLK_DATA, 0, ( mclk_p & 0x03 ) | 0xb0 );
/* Wait for MCLK PLL to lock on frequency */
while (( inTi3026( TVP3026_MEM_CLK_DATA ) & 0x40 ) == 0 ) {
;
}
/* Set the WRAM refresh divider */
rfhcnt = ( 332.0 * f_pll / 1280000.0 );
if ( rfhcnt > 15 )
rfhcnt = 0;
pciWriteLong( MGAPciTag, PCI_OPTION_REG, ( rfhcnt << 16 ) |
( pciReadLong( MGAPciTag, PCI_OPTION_REG ) & ~0xf0000 ));
#ifdef DEBUG
ErrorF( "rfhcnt=%d\n", rfhcnt );
#endif
/* Output MCLK PLL on MCLK pin */
outTi3026( TVP3026_MCLK_CTL, 0, ( mclk_ctl & 0xe7 ) | 0x10 );
outTi3026( TVP3026_MCLK_CTL, 0, ( mclk_ctl & 0xe7 ) | 0x18 );
/* Stop PCLK (PLLEN = 0, PCLKEN = 0 ) */
outTi3026( TVP3026_PLL_ADDR, 0, 0xfe );
outTi3026( TVP3026_PIX_CLK_DATA, 0, 0x00 );
/* Restore PCLK (PLLEN = ?, PCLKEN = ?) */
outTi3026( TVP3026_PLL_ADDR, 0, 0xfc );
outTi3026( TVP3026_PIX_CLK_DATA, 0, pclk_n );
outTi3026( TVP3026_PIX_CLK_DATA, 0, pclk_m );
outTi3026( TVP3026_PIX_CLK_DATA, 0, pclk_p );
/* Wait for PCLK PLL to lock on frequency */
while (( inTi3026( TVP3026_PIX_CLK_DATA ) & 0x40 ) == 0 ) {
;
}
}
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Matrox X-Server Startup
[not found] <199706210006.RAA11651@yoda.veritas.com>
@ 1997-06-21 6:55 ` Harald Koenig
0 siblings, 0 replies; 2+ messages in thread
From: Harald Koenig @ 1997-06-21 6:55 UTC (permalink / raw)
On Jun 20, Michael B. Schmitz wrote:
>
> The following function comes from the XFree86-3.3 source code. I have
> a Matrox millenium which fails to work with the X server. The server loops
> forever at the lines marked with an 'X' below. Again, I am puzzled. Could
> this have anything to do with the preceding message?
I don't know the "preceding message"
> /* Loop here forever -- mbs */
>
> /* Wait for PCLK PLL to lock on frequency */
> X while (( inTi3026( TVP3026_PIX_CLK_DATA ) & 0x40 ) == 0 ) {
> X ;
> X }
which mode line and exact pixel clock are you using ? does this happen
only for one specific dot clock rate ? to to use a slightly different clock rate
and see if the PLL correctly locks then.
I've never seen this happen for correct dot clock rates on any S3 chip.
no real idea, maybe power supply problem on the card or within the chip
might be one reason for not locking correctly for correct PLL programming...
if this doesn't help try to add a small timeout to this loop (say, after 1e5-1e6 iterations...)
and see what's displayed on your screen...
Harald
--
All SCSI disks will from now on ___ _____
be required to send an email notice 0--,| /OOOOOOO\
24 hours prior to complete hardware failure! <_/ / /OOOOOOOOOOO\
\ \/OOOOOOOOOOOOOOO\
\ OOOOOOOOOOOOOOOOO|//
Harald Koenig, \/\/\/\/\/\/\/\/\/
Inst.f.Theoret.Astrophysik // / \\ \
koenig@tat.physik.uni-tuebingen.de ^^^^^ ^^^^^
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1997-06-21 6:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <199706210006.RAA11651@yoda.veritas.com>
1997-06-21 6:55 ` Matrox X-Server Startup Harald Koenig
1997-06-20 9:06 Michael B. Schmitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox