English
Language : 

ST486DX Datasheet, PDF (13/34 Pages) STMicroelectronics – PROGRAMMING MANUAL
ST486DX - SMM SOFTWARE CONSIDERATIONS
3.
SMM SOFTWARE CONSIDERATIONS
This section provides an overview of SGS-Thomson SMM coding and information helpful in devel-
oping SMM code.
3.1 Enabling SMM
Many systems have memory controllers that aid in the initialization of SMM memory. SGS-Thom-
son SMM features allow the initialization of SMM memory without external hardware memory re-
mapping.
When loading SMM memory with an SMI interrupt handler it is important that the SMI# does not
occur before the handler is loaded. This can be done by not setting SMAC=0 and SMI=1 before
the SMI handler is installed. It is necessary to load SMAR with appropriate values before the
SMM memory is accessible. To load SMM memory with a program it is first necessary to enable
SMM memory without enabling the SMI pins by setting SMAC. Setting SMI=1 will then map the
SMM memory region over main memory. The SMM region is physically mapped by the assertion
of SMADS# to allow memory access within the SMM region. A REP MOV instruction can then
be used to transfer the program to SMM memory. After initializing SMM memory, negate SMAC
to activate potential SMI#s.
SMM space can be located anywhere in the 4-GByte address range. However, if the location of
SMM space is beyond 1 Mbyte, the value in CS will truncate the segment above 16-bits when
stored to the stack. This would prohibit doing calls or interrupts from real mode without restoring
the 32-bit features of the 486 because of the incorrect return address on the stack.
; load SMM memory from system memory
include SMIMAC.INC
SMMBASE = 68000h
SMMSIZE = 4000h
SMI = 1 shl 1
SMAC = 1 shl 2
MMAC = 1 shl 3
;SMM SIZE is 16K
mov al, 0cdh
out 22h, al
mov al, 00h
out 23h, al
mov al, 0ceh
out 22h, al
mov al, 06h
out 23h, al
mov al, 0cfh
;index SMAR, SMM baseA31-A24
;select
;set high SMM address to 00
;write value
;index SMAR,SMM baseA23-A16
;select
;set mid SMM address to 06h
;write value
;SMAR,SMM baseA15-A12 & SIZE
23