This document outlines the rec omme nde d proce d ure for programming the inte rna l re gis ters of the Viper Xpress + Chips et .
It is intende d to be a reference for a BIOS develop er using
the Viper Xpress+ Chipset in a PC design. This document
classifie s the i nterna l regist ers of the Viper Xpress + Chips et
based on the subsystems that they control.
Figure 1Boot Setting
Progra m chip se t re g isters for f a il sa fe operation
Program chipset registers for re q ui re d pin multiple xi ng
Memory detection and selection
Shadow BIOS ROM
Discussion
BIOS Settings
Given below is a chipset specific illustrative flow char t that a
BIOS needs to follow to program the chipset registers.
Tables 1 through 4 provide the register settings r equired of
the chipse t that the BIOS sh ould ensure in order for t he system to boot. These are fail safe boot values.
Size and enable cache
Program chipset registers for optimum reliable performance
(i.e., wait states for cache , DRAM PCI cycl es, etc.)
Enable performance enhancing features
Program IDE as a single- or multi-function device
PCI initialization
may be done
PCI interrupt assignment
Program chipset registers using values
defined in the board BIOS spec
OPTi Inc. makes no representations or warranties with respect to the design and documentation herein described and especially disclaims any implied warranties of
merchantability or fitness for any particular purpose. Further, OPTi Inc. reserves the right to rev i se the design and associated documentation and to make changes
from time to time in the content without obligation of OPTi Inc. to notify any person of such revisions or cha nges.
915-2000-067Page 1 of 27
Revision: 1.0OPTi C onfidential
Enable de ep bu ffe rs b efore giv ing control to bo ot O S
The Viper Xpress+ Chipset allows a great amount of flexibility
to enable the system designer to tailor the design optimally to
meet requi r eme nts . The BIO S pr o gra mme r shoul d obta in the
hardware muxing information f rom the board designer to program the pin mux ing re gister s. These values shoul d be pr ogrammed once and should not be changed during warm
resets.
Table 582C578 Group-Wi se Regi ster P rog ramm ab le Pins
Globally, the de s igner can program two bits in the 82C578 to
enable a group of pins t o take on dif ferent functions or can
individually program bits to assign the desired functionality on
a pin-by-pin basis. Table 5 shows the group-wise pin program ming opti on and Ta ble 6 shows t he register bits used in
pin programming (pin- and group-wise ).
(1) Also the se PCI DV1 re g ister bits must be set: 54h[ 4] = 1, 55h[4] = 0, and 5Fh[4] = 0.
(1)
EPMI0# mux-
ing on Pin 1:
0 = Disable
1 = Enable
Pin 106
functionality:
(1)
0 = RTCRD#
1 = PGNT3#
For SDACK2#
function on this
pin, see
PCIDV1 5Eh[6].
For PCI soft
reset generatio n t hrou gh
RTCRD#, see
PCIDV1 61h[7]
and 62h[7 ].
PCIDV1 5EhSteerab le D RQ Control Reg iste rDefault = 00h
SDRQ/
SDACK# func-
tion s on pins
105 and 107:
0 = Disable
1 = Enable
(1) Pin 10 5 fun ct io ns a s SDRQ1 a n d pin 107 functions as SDACK1#. Also re fe r to P CIDV1 60h[4].
(2) Pin 10 4 fun ct io ns a s SDRQ2 a n d pin 106 functions as SDACK2#. Also re fe r to P CIDV1 51h[7] and 59h[0].
PCIDV1 5FhSteerable IRQ Control RegisterDefault = 00h
Pin 52
functionality:
0 = Reserved
1 = MSGN2S
(1) Also the se PCI DV1 re g ister bits must be set: 54h[ 4] = 1, 55h[4] = 0, and 59h[3] = 0.
PCIDV1 60hUSB Interrupt Control RegisterDefault = 00h
Table 682C578 Pin Functio nal ity Pro gram ming Register Bits (cont.)
76543210
Pins 105 and
107
functionality:
0 = RTCAS+
SDRQ1 on
pin 105 and
RTCWR#+
SDACK1#
on pin 107
1 = PREQ4#
on pin 105
and
PGNT4#
on pin 107
PCIDV1 61hPCI Reset Control RegisterDefault = 00h
PCI soft reset
generation
throug h
RTCRD#:
0 =N o action
1 =G enerate a
100µs PCI
reset pulse
if PCIDV1
62h[7] = 0
USBGNT# thru
RTCWR#
(pin 107):
0 = Enabled
only if
PCIDV1
5Fh[7] = 1
1 = Disable (no
USBGNT#
functionality)
Buffered DMA LOCK# thru
SERIRQ#/RTCAS pins:
00 = No BFLOCK# thru either pin
01 = BFLOCK# thru SERIRQ# pin
(pin 1)
10 = BFLOCK# thru RTCAS pin
(pin 105)
11 = Reserved
These bit settings wi ll ov erride
PCIDV1 60h[4], 5Fh[4], 59h[3]
and 5Eh[7].
PCIDV1 62hEmulation Control RegisterDefault = 00h
Pin
functionality:
0 = PCIRES#
enable
1 = PCIRES#
disable
OPTi
Page 1 0 of 27915-2000-067
®
Revision: 1.0
OPTi ConfidentialApplication Note
Table 782C579 Pin Functio nal ity Pro gram ming Register Bits
76543210
SYSCFG 26hISA Control RegisterDefault = 00h
USBGNT#:
0 = Through
me ssaging
pro tocol
1 = Through
pin 58
SYSCFG 2DhBank-wise EDO Timing Selection Registe rDefault = 00h
DIRTYI pin
(pin 158) mux:
0 = MREF#
(MCACHE)
1 = NVMCS
SYSCFG 2EhPCI Mast er RegisterDefault = 00h
BFLOCK pin
(pi n 177)
control:
0 = Disable
1 = Enable
Pin 102
functionality:
0 = USBCLK
1 = REFRESH#
MSGN2S/
MSGS2N bus
ena bling:
0 = Disable
1 = Enable
DRAM Subsystem
After a p ower-on res et when the BIOS att empts t o configure
the DRAM subsystem, the registers that affect the DRAM
subsystem are lo cat ed in the 82C579. All the registers that
control the DRAM subsy ste m ar e acce ssed by the 22h, 24h
indexing scheme (to access the System Control Register
Space - SYSCFG).
The Viper Xpress+ Chipset supports up to six banks of
DRAM. Given below is a step-by-step procedure for initi alizing the DRAM subsystem of the chipset. Tabl e 8 shows the
registers associated with configuration of the DRAM subsystem.
Step 1
Program SYSCFG 13h[7] = 1. This will enable the Viper
Xpress+ Chipset to fully decode the incoming addres s.
Step 2
The BIOS sh ould then progra m the size of eac h DRAM ban k
to be the maximum size before it determines the exact size of
memory in each bank.
SYSCFGLogical Bank Addressed
13h[2:0]Logical Bank 0
13h[6:4]Logical Bank 1
14h[2:0]Logical Bank 2
14h[6:4]Logical Bank 3
19h[2:0]Logical Bank 4
19h[6:4]Logical Bank 5
OPTi
915-2000-067Page 11 of 27
Revision: 1.0
®
Application NoteOPTi Confidential
Notes:
A. SYSCFG 19h[7] and 19h[3] should be set to 1 be fore
starting DRAM sizing.
B. The maximum DRAM size setting in each register is
16Mx72 which corresponds to a 3-bit binary code of
E. Abov e all, the L1 and L2 caches must be disabled when
the DRAM subsystem is being initialized.
Step 3
Size Logical Banks 0 through 5 and program the appropriate
3-bit binary code in the appropriate registers.
“111”.
Table 8DRAM Confi gur atio n Registers
76543210
SYSCFG 13hMemory Decode Control Register 1Default = 00h
Memory decode
select:
This bit must
be set to 1 for
full decode
(maximum flexibility in choosing different
DRAM configurations)
SYSCFG 14hMemory Decode Control Register 2Default = 00h
This secti on of the do cument explai ns the mecha nism used
to automatically detect EDO DRAM SIMMs located on the
motherboard by the Viper Xpress+ Chipset.
Detection between WE# controlled EDO DRAMs and Fast
Page Mode DRAMs
Differentiating between thes e two type of DRAMs is a little bit
more complex because FP M ode DRAMs spe cified at 70ns,
could perform better than their rating and thus may even work
with tighter timing. A second factor that makes the detecti on
complex is the large capacitiv e load pres ented by t he DRAM
on the MD bus. This capacitive load manifests itself in the
form of large discharge times, thereby retaining the last
driven value on the bus for long periods of time.
A solution to this problem is to latch data into the chipset after
a significantly large ti me after the CAS has bee n pulled high.
Also an at tempt c ould be made to ge nerate a conflict on the
bus, thereby discharging the bus and then attempting to read
back the data prese nt on the MD bus.
When SYSCFG 1Fh[6] (in the 82C579) is set to “1” it puts the
Viper Xpress+ Chipset in the Mode of EDO DRAM de tection.
This will cause a quad-word to be read in 4µs . When bit 6 is
set, setting bit 7 to a “1” will cause a conflict to be gene rated
at about 2µs, if necessary.
An algorithm is given below to use this feature and detect the
type of DRAM used on the board. Refer to
Size the first b ank
1.Set SYSCFG 1Fh[6] = 1.
2.Set SYSCFG 1Fh[7] = 1. This step ne eds to be done
only if the user desire s to create a conflict on the bus.
3.Write a known pattern to a pre-determined location in
DRAM.
4.Write a second different pattern to a second pre-determined location in the DRAM.
5.Read back data from the first pre-determined location in
DRAM.
6.Read back data from sec ond pre-determined location.
7.If data read back is the same as the data written to the
first pre-determined location, then the DRAM SIMMs are
WE# EDO SIMMs , othe rwis e they are Fas t Page Mode
DRAM SIMMs.
8. Set SYSCFG 1Ch[2] = 1 if Bank 0 = EDO
Set SYSCFG 1Ch[2] = 0 if Bank 0 = FP DRAM
...........
...........
...........
Set SYSCFG 1Ch[7] = 1 if Bank 5 = EDO
Set SYSCFG 1Ch[7] = 0 if Bank 5 = FP DRAM
9.Repeat for all banks.
Note: While EDO auto detection is in progress, hidden
refresh should be disabled.
Table 9Register Bi ts Ass oci ated with E DO DRA M Auto Detectio n
76543210
SYSCFG 1ChEDO DRAM Control RegisterDefault = 00h
EDO DRAM usage:
Each bit is set to a 1 if the user is using EDO DRAMs in each of the available six banks. Bit 2 corresponds
to B an k 0 an d bi t 7 corres ponds to B an k 5, yielding a t otal of si x bank s t hat the user c an populate.
0 = Standard page mode DRAM
1 = EDO DRAM
SYSCFG 1FhEDO Timing Control RegisterDefault = 00h
0 = Normal
1 = Generate
conflict during EDO
detection
(bit 6 set) if
necessary
0 = Normal
(f ast page
mode)
1 = Detect EDO
OPTi
915-2000-067Page 13 of 27
Revision: 1.0
®
Application NoteOPTi Confidential
Shadowing the ROM Area
The BIO S needs to shadow the F0000 area so that the BIOS
code can execute out of local memory. Given below is an
algorithm to achieve this and shows the 82C578 and 82C579
associat ed register b its.
1.The BIOS should set PCIDV1 4Bh[7:6] = 00. This
enables generation of the ROMCS# by the 82C578
whenever the address is i n the F0000 segment.
2.The BIOS should then set SYSCFG 06h[3:2] = 10. This
causes all reads to the F0000 segment to go across the
PCI bus while all writes will be performed on the DRAM.
Table 10 Register Bits Associ ated wi th ROM Shado wi ng
76543210
PCIDV1 4BhROMCS# Range Control Register - Byte 1Default = 00h
ROMCS# for
FFFF8000h-
FFFFFFFFh
segment:
0 = Enable
1 = Disable
ROMCS# for
FFFF0000h-
FFFF7FFFh
segment:
0 = Enable
1 = Disable
ROMCS# for
FFFE8000hFFFEFFFFh
segment:
0 = Disable
1 = Enable
ROMCS# for
FFFE0000h-
FFFE7FFFh
segment:
0 = Disable
1 = Enable
4.The BIOS should then copy the contents of the ROM in
the F0000 segment to DRAM.
5.The BIOS should set PCIDV1 4Bh[7:6] = 11. This disables generation of the ROMCS# by the 82C578 whenever the address is in the F0000 segment.
6.The BIOS should then set register SYSCFG 06h[3:2] =
11. This causes all reads and writes to be performed on
the DRAM.
ROMCS# for
FFFD8000hFFFDFFFFh
segment:
0 = Disable
1 = Enable
ROMCS# for
FFFD0000h-
FFFD7FFFh
segment:
0 = Disable
1 = Enable
ROMCS# for
FFFC8000hFFFCFFFFh
segment:
0 = Disable
1 = Enable
ROMCS# for
FFFC0000h-
FFFC7FFFh
segment:
0 = Disable
1 = Enable
SYSCFG 06hShadow RAM Control Register 3Default = 00h
DRAM hole
in system
memory f rom
80000h-
9FFFFh:
0 = N o hole in
memory
1 = Enable hole
in memory
(1) This setting gives the user the option to have some other device in the address range 80000h-9FFFFh instead of system memory. When
bit 7 is set, the 82C579 will not start the syste m DRAM con tro ller for ac cesse s to this particular address range .
Wait state addi-
(1)
0 = Do not add
1 = Add a wait
tion for PCI
master
snooping:
a wait state
for the
cycle
access finish to do the
snooping
state for the
cycle
access to
finish and
then do the
snooping
C0000h-
C7FFFh
cacheability:
0 = Not
Cacheable
1 = Cacheable
in L1 and L2
(L1 disabled b y
SYSCFG
08h[0])
F000 0hFFFFFh
cacheability:
0 = Not
Cacheable
1 = Cacheable
in L 1 and L2
(L1 disabled by
SYSCFG
08h[0])
F0000h-FFFFFh
read/write control:
00 = Read/write PCI bus
01 = Read from DRAM / write to
PCI
10 = Read from PCI / write to
DRAM
11 = Read/write DRAM
If SYSCFG 04h[2] = 1, then the
E0000h-EF FFFh read/write control should have the same setting
as this.
00 = Read/write PCI bus
01 = Read from DRAM / write to
10 = Read from PCI / write to
11 = Read/write DRAM
E0000h-EF FFF h
read/write control:
PCI
DRAM
OPTi
Page 1 4 of 27915-2000-067
®
Revision: 1.0
OPTi ConfidentialApplication Note
PCI Bus Master IDE Configurati on Requirem e nts
The system IDE controller configura tion is done by the BIOS
in two phases. The first phase takes place whe n the device s
on the PCI bus are initialize d. During this phase, the BIOS
assigns interrupts and sets the level of the interrupts. The
second phase of configuring the IDE contr oller takes place
when the features in the system are enabled. During this
phase, the IDE controller is configured for optimum performance based on the drives installed in the system. Thi s is
when the timing of the IDE controller is programmed into t he
internal registe r s of the co ntroll e r.
The following section include s the tasks that are done by the
BIOS during both of these phases. The BIOS is req uired to
separate the two phases based on the guidelines provi ded
above.
In order to optimiz e the PCI IDE Module for both DMA and
PIO operations, the following steps are expect ed to be fulfilled by the system BIOS:
1.Enable the PCI IDE Module: PCIDV1 4Fh[6] = 1.
2.Configure the PCI IDE Module through Mechanism #1 as
Bus #0, Device #1, and Function #1. Also set SYSCFG
FFh[4] = 1 (82C578).
3.Detect the PCI bus frequency and record it into IDE I/O
Address 1F5h[0]. For a synchronous PCI Viper Xpress+
system, the PCI bus frequency equals the system bus
frequency divided by two.
If a 25MHz PCI bus is detected, a 1 should be written
into the IDE I/O Address 1F5h[0] and 01 s hould be written into PCIDV1 47h[5:4] for the proper ISA clock divisor
as well.
If the Viper Xpres s + sy st em is configur e d for a n asyn chronous PCI cloc king scheme , the re is no need to perform this checking since an externa l 33MHz (power -up
default) is feeding into the IDE module.
4.The default IDE ownership at PCIIDE 40h[4] should be
set to 1. This allows the multiplexed ISA/IDE bus always
park to the IDE Module.
5.The 32-by te re ad pre fet ch FIFO sh o uld be ena bled by
setting PCIIDE 40h[5] = 1.
6.Concurr en t ref resh and I D E cycles should be enabled by
setting PCIDV1 52h[0] = 1.
7.PCI IDE one wait state reads for primary and secondary
channels should be enabled at IDE I/O Address 1F3h[4].
8.Read prefetch for primary and secondary channels
should be enabled at IDE I/O Address 1F6h[6] and
176h[6] accordingly.
9.Enable master capability at PCIIDE 04h[2]. Once mastering is enable d, set PCID V1 54 h[7:4] = Fh.
10. Assign value for bus master IDE base addres s at
PCIIDE 20h-23h.
11. Depe n di n g o n the ca pabilitie s of the syst em’s hard
drives and the PCI bus frequency, setup the IDE timings
accordingly. The applicable SET_FEATURES commands (i.e., Flow Control Enable) should be issued to
the c orresponding IDE drives as well.
12. If no device is in the primary slave (Drive 1) location, set
the command pulse and recovery time (1F 0h/1 F1h,
Index-1) to correspond to PIO Mode 0.
13. If no device is in the secondary ma ste r (Drive 0) location
or slave (Drive 1) location, set the command pulse and
recovery time (170h/171h, Index-0 and 170h/171h,
Index-1) to correspond to PIO Mode 0.
Table 11 PCI Bus Master IDE Configurati on Associ ated Registe r Bits
76543210
PCIDV1 4FhMiscellaneous Control Register - Byte 1Default = 00h
IDE
functionality
support:
0 = Disable
1 = Enable
SYSCFG FFhGeneral Purpos e Chip Selec t Control Reg isterDefault = 00h
Reserved:
Must be written
to 1 .
OPTi
915-2000-067Page 15 of 27
Revision: 1.0
®
Application NoteOPTi Confidential
Table 11 PCI Bus Master IDE Configurati on Associ ated Registe r Bits
76543210
I/O Address 1F5hStrap RegisterDefault = xxh
PCI CLK speed:
0 = 33MHz
1 = 25MHz
PCIDV1 47hCycle Control Register 1 - Byte 1Default = 00h
ATCLK frequency select:
00 = LC LK÷4
10 = LC LK÷2
01 = LC LK÷3
11 = LC LK
PCIIDE 40hIDE Initia liza tion Control RegisterDefault = 00h
Enha nced
slave:
0 = 82C621A-
compatible
mode, uses
a 16-byte
FIFO in
PIO Mode
1 = Enhanced
mode, uses
a 32-byte
FIFO in
PIO Mode
Reserved:
Must be written
to 1 .
PCIDV1 52hInterrupt Multiplexing Control Register - Byte 0Default = 00h
Concurrent
r ef res h and
IDE cycle:
0 = Disable
1 = Enable
ISA devices that
rely on accurate refresh
addres ses for
p roper operation should disable this bit.
I/O Address 1F3hControl RegisterDefault = xxh
Enable one
wait state read:
0 = 2 WS
minimum
1 = 1 WS
minimum for
data reads
OPTi
Page 1 6 of 27915-2000-067
®
Revision: 1.0
OPTi ConfidentialApplication Note
Table 11 PCI Bus Master IDE Configurati on Associ ated Registe r Bits
76543210
I/O Address 1F6hMiscel laneou s Registe rDefault = xxh
Read prefetch:
0 = Disable
1 = Enable
I/O Address 176hMisc ellaneo us RegisterDefault = xxh
Read prefetch:
0 = Disable
1 = Enable
PCIIDE 04hCom ma nd Register - Byte 0Default = 4xh
IDE controller
becomes a PCI
master to gen-
erate PCI
accesses:
0 = Disable
1 = Enable
Note: This bit
must be explicitly pro gra mmed.
PCIDV1 54hPCI Master Control Register - Byte 0Default = 00h
PCI master
write X-1-1-1:
0 = Disable
1 = Enable
PCIIDE 20h-23hBus Master IDE Base Address Register Default = 01000080h
This registe r is the l/O b ase address indica to r for the Bus Ma ster IDE Re gi st ers. The add ress bl ock has a size of 16 bytes .
Bits [3 1: 0] co rresp on d to: 20 h = [7:0 ] , 21 h = [ 15 :8] , 22h = [23:16], 23h = [31:2 4].
- Bits [3:0] are read-only and default to 0001.
- Bits [31:4] are writable.
I/O Addres s 1F0 h, Index-1Read Cyc le Timin g Regi ster-B
The value programmed in this register plus one determines the DRD#
pulse width in LCLK s ( for a 16-bit read fro m the IDE Data Register).
(1) Read Cycle Timing Register-B shares the l/O address with Read Cycle Timing Register-A, indexed by 1F6h[0]. It controls the read cycle
timing of the IDE Data Register for the drive not selected by 1F3h[3:2] if 1F3h[7] = 1.
(2) See Tabl e 14 or Table 15 (of this do cum en t).
PCI master
read X-1-1-1:
0 = Disable
1 = Enable
Read pulse wid th:
PCI master/IDE
concur renc e:
0 = Disable
1 = Enable
(Also see
PCIIDE 42h[4]
and [2])
New AHOLD
protocol:
0 = Disable
1 = Enable
(use HREQ
to latch
AHOLD)
(1)
Read recovery time:
The value programmed in this register plus two determines the recov-
(2)
ery time between the end of DRD# and the next DA[2:0]/DCSx# being
presente d (a fter a 16-bit read fro m the IDE Data Regi ster) , me a su red
in LCLKs.
(2)
Default = xxh
OPTi
915-2000-067Page 17 of 27
Revision: 1.0
®
Application NoteOPTi Confidential
Table 11 PCI Bus Master IDE Configurati on Associ ated Registe r Bits
76543210
I/O Addres s 1F1h, Ind ex -1Write Cycle Timin g Regi ste r-B
Write pulse width:
The val ue p ro gr amme d i n th is register plus one determin es t he DWR #
pulse width in LCLKs (for a 16-bit write from the IDE Data Register).
The value programmed in this register plus two determines the recov-
(2)
ery time between the end of DWR# and the next DA[2:0]/DCSx# being
presented (after a 16-bit write from the IDE Data Register), measured
in LCLKs.
(1) Write Cycle Timing Register-B shares the l/O address with Write Cycle Timing Register-A, indexed by 1F6h[0]. It controls the write cycle
timing of the IDE Data Register for the drive not selected by 1F3h[3:2] if 1F3h[7] = 1.
(2) See Table 14 or Table 15 (of this do cum en t).
Read pulse wid th:
The value programmed in this register plus one determines the DRD#
pulse width in LCLK s (for a 16 -bit read fro m the IDE Data Register).
The value programmed in this register plus two determines the recov-
(2)
ery time between the end of DRD# and the next DA[2:0]/DCSx# being
(1)
Default = xxh
Read recovery time:
presente d (a fter a 16-bit read fro m the IDE Data Regi ster) , me a su red
in LCLKs.
(2)
(1) Read Cycle Timing Register-A shares the l/O address with Read Cycle Timing Register-B, indexed by 176h[0]. It controls the read cycle
timing of the IDE Data Regist er for the drive selected by 173h[3: 2] .
(2) See Table 14 or Table 15 (of this do cum en t).
Write pulse width:
The val ue p ro gr amme d i n th is register plus one determin es t he DWR #
pulse width in LCLKs (for a 16-bit write from the IDE Data Register).
The value programmed in this register plus two determines the recov-
(2)
ery time between the end of DWR# and the next DA[2:0]/DCSx# being
(1)
Default = xxh
Write recovery time:
presented (after a 16-bit write from the IDE Data Register), measured
in LCLKs.
(2)
(1) Write Cycle Timing Register-A shares the l/O address with Write Cycle Timing Register-B, indexed by 176h[0]. It controls the write cycle
timing of the IDE Data Regist er for the drive selected by 173h[3: 2] .
(2) See Table 14 or Table 15 (of this do cum en t).
Read pulse wid th:
The value programmed in this register plus one determines the DRD#
pulse width in LCLK s (for a 16 -bit read fro m the IDE Data Register).
The value programmed in this register plus two determines the recov-
(2)
ery time between the end of DRD# and the next DA[2:0]/DCSx# being
(1)
Default = xxh
Read recovery time:
presente d (a fter a 16-bit read fro m the IDE Data Regi ster) , me a su red
in LCLKs.
(2)
(1) Read Cycle Timing Register-B shares the l/O address with Read Cycle Timing Register-A, indexed by 176h[0]. It controls the read cycle
timing of the IDE Data Register for the drive not selecte d by 173h[ 3:2] if 173h[ 7] = 1.
(2) See Table 14 or Table 15 (of this do cum en t).
Write pulse width:
The val ue p ro gr amme d i n th is register plus one determin es t he DWR #
pulse width in LCLKs (for a 16-bit write from the IDE Data Register).
The value programmed in this register plus two determines the recov-
(2)
ery time between the end of DWR# and the next DA[2:0]/DCSx# being
(1)
Default = xxh
Write recovery time:
presented (after a 16-bit write from the IDE Data Register), measured
in LCLKs.
(2)
(1) Write Cycle Timing Register-B shares the l/O address with Write Cycle Timing Register-A, indexed by 176h[0]. It controls the write cycle
timing of the IDE Data Register for the drive not selecte d by 173h[ 3:2] if 173h[ 7] = 1.
(2) See Table 14 or Table 15 (of this do cum en t).
OPTi
®
Page 1 8 of 27915-2000-067
Revision: 1.0
OPTi ConfidentialApplication Note
Programming PCI Bus Master IDE Timing
The power-up default of the IDE module is PIO Mode 0 for all
four IDE devices. However, any of the IDE devices can be
programmed up to PI O Mode 3. In addition, there are four
sets of registers (two sets for each channel) that allow specific timings to be progra mmed on a “per-devi ce” basis, see
Table 12. These re gi ster sets a re shared by the DMA and
PIO operations. W ith the IDENTIFY_DRI VE command information, the BIOS can opt imize the IDE timing for e ach drive
individually by programming these registers.
Any combination of hard drives or ATAPI devices may be
connected to the two channels of the I DE module in a fourdrive configuration. For each channel, both sets of registers
and the power-up default can be used to control any devices
in the chan nel. See Table 13 for deta ils.
Table 14 and Table 15 show the timing and recommended
register settings for various IDE modes defined in the
Enhanced IDE Specifications. They include PIO transfer, Single-Word DMA transfer, and Multi-Word DMA transfer
modes. The actual cycl e time equals the sum of actua l command active time and actual command inactive (command
recovery and address setup) time. These three timing
requirements shall be met. In some cases, the minimum
cycle time requir ement is gre ater than the sum of the command pulse and command recove ry time. This means either
the command active (command pulse) time, or command
inactive (command recove ry a nd a ddre s s se tup) time can be
lengthene d to ensure that the minim um cy cl e time s are met.
Figure 2 is a flow chart that describes how to program the primary channel of the MIDE interface. For the secondary channel, a similar procedure can be done by changing all the
indexes from 1Fxh to 17xh.
Table 12 Registers for Program mi ng IDE Timin g
NameAddress
Timing Registers-A for Primary Channel1F0h/1F1h - Index-01F3h, 1F5h, a nd 1F6h are shared by both
Timing Registers-B for Primary Channel1F0h/1F1h - Index-1
Timing Registers-A for Secondary Channel170h/171h - Index-0173h, 175h, an d 176h are shared by both
Timing Registers-B for Secondary Channel170h/171h - Index-1
indexes
indexes
Table 13 REGTIMx Programming Options
REGTIM0
1F3h[2]/173h[2]
(1)
1
011Index-1Index-0
001Index-1Index-1
100Index-0
010
000
11XIndex-0Index-0
(1) Recomm ended configurati on
(2) Refer to PCI IDE 40h[1:0]
REGTIM1
1F3h[3]/173h[3]
01Index-0Index-1
REGTIM2
1F3h[7]/173h[7]
Master/Drive 0
Controlled by:
(2)
Defaul t
(2)
Defaul t
Slave/Drive 1
Controlled by:
(2)
Defaul t
Index-0
(2)
Defaul t
OPTi
915-2000-067Page 19 of 27
Revision: 1.0
®
Application NoteOPTi Confidential
Table 14 16-Bit Timing Parameters with 33/30 MHz PC I Bus
IDE Transfer Modes
Multi-Word DMA
Parame ter:
Register BitsDimension
Address Set up:
1F6h/176h[5:4]
R/W Command Pulse:
1F0h/170h/1F1h/
171h[7:4], Index-0/1
R/W Recovery Time:
1F0h/170h/1F1h/
171h[3:0], Index-0/1
Enhanced Mode:
PCIIDE 43h [7:6],
[5:4], [3:2], or [1:0]
DRDY:
1F6h/176h[3:1]
Cycle TimeTiming in LCLKs 20138654175432168
N/S = Not Specified, N/A = Not Applicable
(1) The actual tim in g (in LCL Ks) that will be generated by the IDE controller if the recommended bit values in hex are programmed.
(2) The timing (in ns) as specified in the Enhanced IDE Specification.
N/S = Not Specified, N/A = Not Applicable
Bit values in hex 211100000000
Timing in LCLKs
Enhanced IDE
Spec in n s
Bit values in hex 543222722F84
Timing in LCLKs
Enhanced IDE
Spec in n s
Bit values in hex 940000600D40
Timing in LCLKs
Enhanced IDE
Spec in n s
Bit values in hex 000122012000
Bit values in hex 000000000000
Timing in LCLKs
Enhanced IDE
Spec in n s
(2)
(2)
(2)
(2)
012345 0 1 2 0 1 2
(1)
322211111111
7050303025N/SN/AN/AN/AN/AN/AN/A
(1)
6543338331695
1651251008070N /S2158070480240120
(1)
11621008101562
N/SN/SN/S7025N/S2155025NSNSNS
(1)
222222222222
600383240180120N/S480150120960480240
PIO Modes
Modes
Single-Word DMA
Modes
OPTi
Page 2 0 of 27915-2000-067
®
Revision: 1.0
OPTi ConfidentialApplication Note
Table 15 16-Bit Timing Paramete rs with 25MHz PCI Bus
IDE Transfer Modes
Multi-Word DMA
Parame ter:
Register BitsDimension
Address Set up:
1F6h/176h[5:4]
R/W Command Pulse:
1F0h/170h/1F1h/
171h[7:4], Index-0/1
R/W Recovery Time:
1F0h/170h/1F1h/
171h[3:0], Index-0/1
Enhanced Mode:
PCIIDE 43h [7:6],
[5:4], [3:2], or [1:0]
DRDY:
1F6h/176h[3:1]
Cycle TimeTiming in LCLKs 15106543134324126
(1) The actual tim in g (in LC LKs) that will be generated by the MIDE Module if the recommended bit values in hex are programmed.
(2) The timing (in ns) as specified in the Enhanced IDE Specification.
Func = 182C578 Interrupt Input IDE Interrupts Output
IDE Modes4Fh[6]04h[0]40h[3 ]40h[2 ]09 h[3:0]Pin 135
PrimarySecondary
Disable
(2)
Legacy
NativeDisable1111xx11DINT0ISA IRQ15 PIRQ3#
Legacy
Native
Legacy
NativeNative11011111DINT0DINT1
1. The ISA IRQ14 (ISA IRQ15) will not be availab le to the ISA bus if the on-board prima ry (seco nda ry) IDE is enabled.
2. The 8259 IRQ14 (8259 IRQ15) will not be availa ble for PIRQ[3:0 ]# if the on-boa rd primary (seco nd ary) IDE is enabled .
3. In Native mode, IDE interrupts are shared with PIRQ3# from the PCI bus. It is routed in the same way as PIRQ3# to the interrupt controller
and is controlled by PCIDV1 40h[11:9], 42h[7:1], and 50h[7:6] of the 82C578 (Device #01h, Function #0). Using this mode requires that the
IDE device’s Interrupt Service Routine support interrupt sharing.
Disable
(2)
Native11011110DINT0DINT18259 IRQ14
Legacy
(2)
Legacy
IDE Module
(2)
(2)
Enable
0PCI Config. Registe r Spa ce ca nnot be acces se d
10xxxxxx
1110xxxx
1111xx10
Two consecutive 16-bit I/O reads from 1F1h (any other
I/O cyc le between these two reads will disable access
to the IDE registers) followed by an 8-bit I/O write to
1F2h wi th a value of 03h.
Set the value s in the Timing Registe rs-A (Index-0):
1) Write 0 to 1F6h[0] to point to Timing Registers-A.
2) Follow Table 14 or Table 15 to set proper values in
registers 1F0 h an d 1F1h for read/writ e pul se wi dth
and recovery times and PCIIDE 43h[1:0] for enhanced
timing.
Set the value s in the Timing Registe rs-B (Index-1):
1) Write 1 to 1F6[0] to point to Timing Registers-B.
2) Follow Table 14 or Table 15 and set proper values in
registers 1F0 h an d 1F1h for read/writ e pul se wi dth
and recovery times and PCIIDE 43h[3:2] for enhanced
timing.
Program the Address Setup Time and DRDY Delay Time:
1) Follow Ta ble 14 or Table 15, to set pro p e r valu es into
registers 1F6h[5:4]. Reset 1F6h[3:1] to 0.
2) The above values affect hard drives both in Timing Registers-A and Timing Registers-B. If they are not the same
mode, program the slower timings for the address setup
time.
Enable Register-ba se d Timing to Override Powe r-up
Default Values:
Follow the REGTIMx Programming Options (Table 13) to set
proper v a lue s in the registe r s 1F 3h [7,3,2]. Th i s should be
done after read/write pulse and recovery, address setup,
and DRDY delay have been set.
Exit the IDE I/O Registe rs Progra mmin g Mode:
An 8-bit I/O write to 1F2h with a value of 83h.
Programming and Drive Placement Tips:
1.Ensure that IDE I/O Address 1F6h[0] (176h[0] in the
Secondary channel) is set to 0 whenever accessing Timing Registers-A. It is a common mistake that after
accessing Timing Registers-B, this bit is not reset to 0 by
the BIOS. An error hap pens after a soft res et (thos e bits
will not be reset during a soft reset). The BIOS wants to
3.If no IDE hard drives are in the primary slave, secondary
master location or slave location, set only the command
pulse and recovery time (1F0h/1F1h, Index-1, 170h/
171h, Index-0 and 170h/171h, Index-1) to correspond to
PIO Mode 0. This is to e nsure proper timing for an
ATAPI CD-ROM that may be in any of these locations.
reload the timing sets to both T iming Registers-A and -B.
It would actually write to Timing Registers-B twice.
2.The address setup an d recovery time are shar ed by the
two IDE devices on the same channel at 1F6h[5:1]. If
these two devices are not in the same mode, slower
address setup and recovery time should be programmed
to ensure proper timings on the slower drive. Under this
assumption, two drives should be placed on the separate
channels in a two-drive system. In a multi pl e-drive system, place slower drives on one channel and faster
drives on the other channel.
OPTi
915-2000-067Page 23 of 27
Revision: 1.0
®
Application NoteOPTi Confidential
System Configuration
This section of the document will discuss configura tion of the
I/Os in the Viper Xpress+ Chipset.
Cache Sizing Programming Guide
The followi ng ta s ks ne ed t o be completed in or der to si ze the
cache subsyst em.
1.Performing cache tag test
2.Single bank cache SRAM devices detection
Figure 3Viper Xpress+ Chipset Cache Sizing Program
Turn on L1 as write-through cache; o/p ‘AA’ to Port 80
Write reg ister 07h w/10h, ena bl e wr ite tag test mo de
Populate tags with value 10h by flushing L2 cache
If a usable cache SRAM device is detected, then the cache
needs to be sized. T he foll owi ng ar e va lid cach e sizes for the
Viper Xpress+ Chipset.
• 256KB total cache size
• 512KB total cache size
• 1MB total cache size
• 2MB tota l cache size
The following is a flow diagram of the Vipe r Xpress+ Chi pset
cache sizing progra m.
Read (L1) miss 8 dwords @ A000h and compare
L2 is double bank if all dw match; else single bank
Switch to read tag test mode
Continuously fill 2K lines and check register 07h contents
Loop till end if no mismatch occurs, oth erwi se no tag
Turn off L2 and free ze tag cont en t s; o/p ‘BB’ to Port 80
Set mi s c regs co ntents; turn on L2 as 64 K writeba ck
Write hit location A000h with Pattern A
Read (L1) miss location A000h; no cache if mismatch
Write hit 8 dwords @ A000h each with its location
O/p 80/81/82/83/84 to Port 80; continue if L2 exist
Size L2 as 256KB; o/p 04 if size = 256K, else mo ve on
Size L2 as 512KB; o/p 08 if size = 512K, else mo ve on
Size L2 a s 1MB; o/p 10 if size = 1M, else move on
Size L2 as 2MB; o/p 20 if size = 2M, else no cache
With DL = size (reg 02 ‘OR’) value, program term inat es
Notes: 1. The L2 cac he is placed in the writeback mode by
setting (82C579) SYSCFG 02h[5:4] = 11.
2. The L1 cache’s write-back control bit is set by
programming (82C579) SYSCFG 08h[1] = 1.
Both of these settings should be done by the
BIOS when it e nables the features in the system.
3. o/p = output
OPTi
Page 2 4 of 27915-2000-067
®
Revision: 1.0
OPTi ConfidentialApplication Note
PCI Interrupt Routing
The registers that affect the assignment of interrupts in the
Viper Xpress+ chipset are located in the 82C578. The registers that affect the assignment are PCIDV1 40h, 41h and
50h.
Note: The bits provided above c ontrol the interrupt routing
only when the bits are programmed to a value different from 000. In the event that the bit s are programmed to 000 for a given PIRQx#, then the routing
of that interrupt is controlled by PCIDV1 50h. That
mappin g sche me is provided in Tabl e 18.
Table 18 Enhanced Interrup t Assig nmen t / Control
Interrupt Sensi ng
Whenever PCI interrupts are routed to ISA interrupts, the
interrupt needs to become level-triggered instead of edgetriggered. The only exception is the IDE interrupt (IRQ14).
Table 1 9 lists the r egiste r bits that a ffect the interru pt trigger
mechanism and the associated interrupt.
All feature s listed in this secti on of the document should be
turned on by the BIOS whil e enabling the adva nced fea tures
in the sy stem. Where indicated, the BIOS needs to follow the
order specifi ed whi le turni ng on thes e feat ure s .
Note: Make sure writes t o re gisters PCIDV0 44h-47h are
always 32-bit writes. No memory access should
be allowed in between configuration writes.
• CPU address pipelining
- SYSCFG 08h[2] = 1
• PCI pre-s noop
- The BIOS should turn on SYSCFG 0Fh[7] first and then
turn on SYSCFG 16h[3]. This order should be maintained. As lon g as this order is ma inta ine d no ot her
ordering with regard to the other features needs to be
followed.
• Pa ge mis s poste d write
- SYSCFG 11h[2] = 1
• Hidden refresh (82C568)
- PCIDV1 47h[6] = 1
• Progra mming wait state s during PCI ma ster trans fers
Note: It is highly recommended to program X-1- 1-1
transfers for PCI masters
• CPU-to-DRAM FIFO
- Enable (Sequence must be fo llowed)
- SYSCFG 01h[2] = 1 (CAS width for DRAM write - 2
CLK)
- SYSCFG 02h[0] = 1 (CAS precharge - 1 CLK)
- SYSCFG 02h[1] = 1 (DRAM posted write s if already
enabled this bit will be set to 1)
- SYSCFG 2Ch[1:0] = 11 (Generate BOFF when FIFO
full)
- PCI DV0 44h[4] = 1
- PCI DV0 45h[1] = 1
- Disable - Follow reverse sequence.
Note: If DRAM post write already enabled there is no
need to disable it when turning off this feature. Similarly
for CAS width and precharge.
• PCI -to-DRAM FIFO
- Enable/Disable (Sequence must be followed)
- SYSCFG 20h[3:0] = 0Fh (PCI X-1-1-1 enable)
- PCI DV0 47h[5] = 1
- PCIDV0 44h[2:1] = 00
- PCIDV0 44h[6:5] =
00 - Disable read/write FIFO
01 - Disable read/Enable write FIFO
10 - Enable read/Disable write FIFO
11 - Enable read /write F IF O
- SYSCFG 2Ah[3:2] = 11
(bit 2 enabl es rea ds bur st )
(bit 3 enabl es writ e burst)
• CPU-to-PCI FIFO
- Enable (Sequence must be followed)
- SYSCFG 15h[5:4] = 01 (i f PCI posted writes are
already enabled, this bit will be set to either 01, 10 or
11)
- PCI DV0 44h[7] = 1
- SYSCFG 2Eh[3] = 1
- Disable - Follow reverse sequence.
Note: If PCI post write already enabled do not disable it
when turning off this feature.
• EDO 5-2-2- 2 timing
- Enable (Sequence must be followed)
- Turn on EDO functionality
- SYSCFG 1Dh[4] = 1 (Turns on 7-2-2- 2)
- SYSCFG 1Fh[4] = 1 (Turns on 6-2-2-2)
- SYSCFG 26h[3] = 1
- SYSCFG 2Dh[6] = 1
- SYSCFG 2Dh[5:0] = Set for EDO bank detected
(5-2-2-2)
OPTi
Page 2 6 of 27915-2000-067
®
Revision: 1.0
OPTi ConfidentialApplication Note
• Self Refres h
- Enable
- SYSCFG 27h[2:0] =
100 - i f ext clock is 66MHz
101 - i f ext clock is 60MHz
110 - i f ext clock is 50MHz
111 - i f ext clock is 40MHz
- PCIDV1 54h[0] = 1
- Disable
- PCIDV1 54h[0] = 0
- SYSCFG 27h[2:0] = 000
Note: It is recommended to turn on self refr esh and turn off
- X-1-1-1/2-1-1-1
pipeline set up for ED O
SYSCFG 00h[6] = 1
SYSCFG29h[7] = 1
- X-1-1-1/5-1-1-1
pipeline setup for EDO
Note: For all SDRAM-based systems, the following bits
need to be set:
PCIDV0 48h[4] = 1,
PCIDV0 48h[3] = 0,
PCIDV0 4Eh[6] = 0
PCIDV0 4Eh[5] = 1
PCIDV0 55h[7] = 1
PCIDV0 55h[6] = 1
Deep Buffer Programmi ng
The followi n g sequ e nce shoul d be us ed when enabl ing dee p
buffers.
1.CPU-to-PCI
2.CPU-to-DRAM
3.PCI-to-DRAM
Also the enabl ing of deep buffers with res pect to the entire
BIOS, the followi ng seq uence is recomm ende d.
1.The three deep buffers can be enabled just before giving
control to boot block to st art the OS.
2.When deep buffers are enabled and Ctrl+Alt+Del key is
pressed (soft boot), the BIOS must disable all the thre e
deep buffers in the reverse order of enabling after giving
sufficient time (250 CPU clock time at least) to allow
flushing of buffered data from the buffers. A gain just
before giving control to boot block, they should be
enabled.
3.All the deep buffer enabling/disabling code must be a
tight sequence code without any DRAM or non-configuration PCI cycles in-between.