AMD Geode™ GeodeROM Functional Specification March 2006 Publication ID: 32087C AMD Geode™ GeodeROM Functional Specification
© 2006 Advanced Micro Devices, Inc. All rights reserved. The contents of this document are provided in connection with Advanced Micro Devices, Inc. (“AMD”) products. AMD makes no representations or warranties with respect to the accuracy or completeness of the contents of this publication and reserves the right to make changes to specifications and product descriptions at any time without notice.
Contents 32087C Contents List of Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 List of Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.0 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 1.1 1.2 1.3 2.0 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . .
32087C Contents 10.0 Human Interface Device Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 10.1 INT 16h Functions Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 10.2 PS/2 Pointing Device Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 11.0 System Time and Date . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
32087C Contents 18.0 Configuring/Customizing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243 18.1 18.2 18.3 18.4 18.5 18.6 18.7 18.8 18.9 Quick Start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243 Build Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243 Environment Variable(s) . . . . . . . . . . .
32087C 6 Contents AMD Geode™ GeodeROM Functional Specification
List of Figures 32087C List of Figures Figure 1-1. Figure 3-1. Figure 6-1. Figure 15-1. Figure 18-1. Figure 18-2. Figure 18-3. Figure 18-4. Figure 18-5. Figure 18-6. GeodeROM Functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Xpress Tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 System BIOS INT 13h Interface with Enhanced IDE Data Structures . . . . .
32087C 8 List of Figures AMD Geode™ GeodeROM Functional Specification
List of Tables 32087C List of Tables Table 2-1. Table 2-2. Table 5-1. Table 6-1. Table 6-2. Table 6-3. Table 6-4. Table 7-1. Table 7-2. Table 8-1. Table 9-1. Table 10-1. Table 11-1. Table 12-1. Table 12-2. Table 12-3. Table 12-4. Table 13-1. Table 13-2. Table 13-3. Table 13-4. Table 13-5. Table 14-1. Table 15-1. Table 15-2. Table 15-3. Table 15-4. Table 15-5. Table 15-6. Table 15-7. Table 15-8. Table 15-9. Table 16-1. Table 17-1. Table 18-1. Table 20-1. Table A-1. Summary of Supported INTx Functions . .
32087C 10 List of Tables AMD Geode™ GeodeROM Functional Specification
Overview 32087C 1 1.0Overview 1.1 Scope GeodeROM is the firmware for AMD Geode™ solutions. It is a set of components designed to initialize devices, provide interrupt services, and emulate traditional hardware functionality. GeodeROM is targeted for platform designs using an AMD Geode™ GX1, AMD Geode™ GX, or AMD Geode™ LX processor and companion device or a single chip processor (e.g., SC1100, SC1200, SC1201, SC2200, SC3200). Figure 1-1 illustrates the general functionality of GeodeROM. 1.
32087C 1.3 Overview Features GeodeROM provides support to Geode solutions and provides the following initialization and runtime API (application programming interface) support: ■ Legacy Power Management — GeodeROM provides operating system transparent power management. ■ APM (Advanced Power Management) Real Mode/Protected Mode APIs — The GeodeROM INT 15h API supports the APM 1.
Overview 32087C ■ INT 15h Functions — Function 24h (A20 Gate Support) – Contains functions for enabling, disabling, and querying the status of the A20 Gate. — Function 87h (Extended Memory Block Move) – Provides traditional 286 PC/AT-style service to applications, drivers, and operating systems that move blocks of memory to, from, or within extended RAM while executing in real mode.
32087C Overview ■ Legacy USB — GeodeROM can be configured to support legacy USB, thereby allowing the use of a USB keyboard and mouse before a driver is loaded by the operating system. Associated with this functionality is a “virtual keyboard controller” module, allowing for a standard keyboard BIOS look and feel, in the absence of a keyboard controller. ■ USB Floppy Boot Support: — Supports booting USB floppy drives in systems without a standard floppy drive.
Overview 32087C ■ SMI (System Management Interrupt)-Based Memory Access Capability — An SMI handler feature useful for debugging in unfamiliar or highly protected environments has the ability to read or write addressable locations in the system. This is done through a virtual register access. ■ VSA2 Software Initialization — Contains sequences of code to decompress, load, and invoke the SMI handler.
32087C 16 Overview AMD Geode™ GeodeROM Functional Specification
Introduction 32087C 2 2.0Introduction This functional specification discusses supported GeodeROM software interfaces, and use of the GeodeROM source code, including project builds and current functionality modification. This specification is intended for BIOS, or deployment engineers working on AMD Geode™ solutions. 2.1 Supported INT/Functions GeodeROM supports several INT instructions and associated functions/subfunctions, summarized in Table 2-1.
32087C Introduction Table 2-1.
32087C Introduction Table 2-1. Summary of Supported INTx Functions (Continued) Function Subfunction BEh C0h Function Description Reference 00h Read ACCESS.bus Byte Page 131 01h Write ACCESS.bus Byte Page 132 02h Write ACCESS.
32087C Introduction Table 2-1.
32087C Introduction Table 2-1.
32087C Introduction Table 2-1.
32087C Introduction Table 2-1.
32087C 2.2 Introduction Acronyms and Definitions This specification uses several acronyms. Table 2-2 lists, in alphabetical order, the acronyms and their definitions. Table 2-2.
Code Structure 32087C 3 3.0Code Structure The following subsections discuss the GeodeROM directory structure. 3.1 User Directory All project-specific files are stored in the user directory. The default user directory is XPRESS\USER, but it is not recommended as a project user directory. Rather a separate subdirectory outside the Xpress tree should be made to hold the user directories. A sample makefile is included in the XPRESS\USER directory.
32087C 3.2 Code Structure Overrides Any source file (.asm) in the build may be overridden by copying the file into the user directory or the project directory. When GeodeROM is rebuilt, the copy of the file in one of these directories is used instead of the copy in the Xpress tree. Figure 3-1 depicts the GeodeROM core. The SMI handler may be overridden by files VSA.ROM or VSA2.ROM copied into the user directory. This allows easy changes on a project-by-project basis.
POST 32087C 4 4.0POST This section outlines the POST (Power-On Self Test) execution flow for GeodeROM, along with the associated checkpoints that are sent to I/O Port 80h. POST is executed out of xpress.asm.
32087C Post Code Sub Code 02h1 --- 03h 28 POST Function Name Function Description startTest/cpuRegInit CPU configuration registers initialize. A9h UserCpuInit/ RestoreFromRam Entering RestoreFromRam. Invalidate cache tags and clear GPE and PM1A events. AAh RestoreFromRam Clear ACPU_BIOS_ST event, set GPWIO0 active-low, prepare GPWIOs, enable SCI generation and RTC wakeup. ABh RestoreFromRam/memResume Call memResume. ACh memResume Enter memResume.
32087C POST Post Code Sub Code 06h --- 07h 08h Function Name Function Description startTest/memSetup Autosize memory controller DIMM1 and DIMM0. 70h memSetup Set the clock drive strength and shift value. Mask the clocks. 72h memSetup Set the data, address, and control drive. Clear reference timer and VGA wrap. 73h memSetup Initialize register; no DIMMs installed. 74h memSetup Initialize CAS latency. 75h memSetup Begin sizing DIMMs.
32087C Post Code Sub Code 14h 12h 1. 30 POST Function Name Function Description --- keyboardInit Wakeup the keyboard controller. --- startTest/romCopy Initialize the Soft A20, power management, SMI handler, and virtual audio SMM system. D0h romCopy Enter ROM copy routine. D1h romCopy Begin image decompress loop. D2h romCopy Call VSA/SMM initialization code. Virtual register initialization. 10h romCopy/VSA_Init Begin VSA initialization.
Removable Media 32087C 5 5.0Removable Media This chapter discusses the support GeodeROM provides for removable media devices, such as floppy disk drives. 5.1 Floppy Disk Drive Support GeodeROM provides INT 40h and boot support for one 1.44 MB, 3.5” floppy disk drive. As in a traditional boot ROM, only device 0 (A: drive) is bootable. The proper access method for the INT 40h functions is through the INT 13h service routines.
087C 5.2.1 Removable Media Function 00h - Reset Disk Subsystem Description: In an ATA drive-equipped system, this function toggles bit four, in register six, of the Control Register Block. This causes the disk(s) to recalibrate internally and seek to cylinder zero. Supports: Fixed disks and floppy disks.
32087C Removable Media 5.2.2 Function 01h - Get Disk Subsystem Status Description: Returns the status of the last disk operation in the AH register. Supports: Fixed disks and floppy disks. Passed: Parameter Description AH 01h DL Drive number Returns: Parameter AH Description Status of the last disk operation: See AH in "Function 00h - Reset Disk Subsystem" on page 32 Special Instructions: The system BIOS stores the status of the last fixed disk operation in location 40:74h in the BDA.
32087C 5.2.3 Removable Media Function 02h - Read Sectors Description: Reads a caller-specified number of sectors in the buffer specified by the ES:BX register pair. Supports: Fixed disk and floppy disk.
32087C Removable Media 5.2.4 Function 03h - Write Sectors Description: Writes a caller-specified number of sectors in the buffer specified by the ES:BX register pair. Supports: Fixed disk and floppy disk.
32087C 5.2.5 Removable Media Function 04h - Verify Sectors Description: Verifies the existence and integrity of the sectors specified by the caller. Supports: Fixed disk and floppy disk.
32087C Removable Media 5.2.6 Function 05h - Format Track (Floppy Disk) Description: Performs a low level function on a single floppy diskette track. The calling application passes a far pointer to a 4-byte table specifying low level format parameters. Supports: Floppy disk only.
32087C 5.2.7 Removable Media Function 08h - Get Drive Parameters Description: Returns the geometry of the caller-specified drive in terms of cylinders, heads, and sectors. If the specified drive is a “large” IDE drive whose physical cylinder count exceeds 1024, this function returns “logical” or “translated” parameters. Supports: Fixed disk and floppy disk.
32087C Removable Media 5.2.8 Function 0Dh - Alternate Disk Subsystem Reset Description: Reinitializes the fixed disk controller, resets the specified drive’s parameters, and recalibrates the drive’s heads (seek to track 0). Both the master drive and the slave drive respond to the reset function issued to either drive. Supports: Fixed disk and floppy disk.
32087C Removable Media Special Instructions: None. Related Functions: INT 13h "Function 17h - Set Disk Type" on page 41. 5.2.10 Function 16h - Get Disk Change Status Description: Returns the value of the floppy controller disk status change line, indicating whether the user has removed or inserted a floppy diskette in the specified drive since the last read, write, or verify operation on that drive. Supports: Floppy disk only.
32087C Removable Media 5.2.11 Function 17h - Set Disk Type Description: Used by older operating systems to specify the physical geometry of a floppy disk to be formatted. Modern operating systems use INT 13h, Function 18h (Set Media Type) because it allows for non-standard geometries, such as those used to support 3-mode floppies in the Japan marketplace for NEC and Toshiba systems. Supports: Floppy disk only.
32087C 5.2.12 Removable Media Function 18h - Set Media Type Description: This function is invoked by the operating system to specify the geometry of the diskette about to be formatted. It supersedes INT 13h, Function 17h, although both are still valid for standard (non 3-mode) 5 1/4” and 3 1/2” disks. Supports: Floppy disk only.
Non-Removable Media 32087C 6 6.0Non-Removable Media GeodeROM provides support for the following non-removable media devices: • SanDisk’s CompactFlash (e.g., SanDisk) devices • Traditional, rotating media IDE drives Note: The term “ATA Device” describes those devices that support the command protocol described in the Small Form Factor Committee’s ATA-4 Specification. CompactFlash and rotating media IDE drives both belong to the family of ATA devices.
32087C Non-Removable Media The format of the caller-supplied parameters and return values adheres to standard industry descriptions of the INT 13h API for floppy drives, as outlined in innumerable references, such as the “IBM PC/AT Technical Reference Manual,” “PC Interrupts”, etc. A description of each function is provided next. 6.2 INT 13h Functions Descriptions This section describes the parameters and return values for each ATA device-specific INT 13h function in GeodeROM.
Non-Removable Media 32087C Returns: Parameter Description CF 0 = Success 1 = Failure AH Status of the last disk operation: 00h = Operation completed successfully (fixed, floppy) 01h = Illegal/Unrecognized command (fixed, floppy) 02h = Sector address mark not found (fixed, floppy) 03h = Attempt to write to write-protected disk (fixed, floppy) 04h = Sector not found (fixed, floppy) 05h = Reset failure (fixed only) 06h = Diskette change signal (floppy only) 07h = Parameter activity failed (fixed only) 0
32087C 6.2.2 Non-Removable Media Function 01h - Get Disk Subsystem Status Description: Returns the status of the last disk operation in the AH register. Supports: Fixed disks and floppy disks. Passed: Parameter Description AH 01h DL Drive number Returns: Parameter AH Description Status code: See AH in "Function 01h - Get Disk Subsystem Status" on page 46 Special Instructions: The system BIOS stores the status of the last fixed disk operation in location 40:74h in the BDA.
Non-Removable Media 6.2.3 32087C Function 02h - Read Sectors Description: Reads a caller-specified number of sectors in the buffer specified by the ES:BX register pair. Supports: Fixed disk and floppy disk.
32087C 6.2.4 Non-Removable Media Function 03h - Write Sectors Description: Writes a caller-specified number of sectors in the buffer specified by the ES:BX register pair. Supports: Fixed disk and floppy disk.
Non-Removable Media 6.2.5 32087C Function 04h - Verify Sectors Description: Verifies the existence and integrity of the sectors specified by the caller. Supports: Fixed disk and floppy disk.
32087C 6.2.6 Non-Removable Media Function 08h - Get Drive Parameters Description: Returns the geometry of the caller-specified drive in terms of cylinders, heads, and sectors. If the specified drive is a “large” IDE drive whose physical cylinder count exceeds 1024, this function returns “logical” or “translated” parameters. Supports: Fixed disk and floppy disk.
Non-Removable Media 6.2.7 32087C Function 09h - Set Drive Parameters Description: Initializes the fixed disk controller with the parameters that correspond to the installed drive. The intent of this function was originally to allow a plug-in ISA drive controller to service many different types of drives.
32087C 6.2.8 Non-Removable Media Function 0Ch - Seek to Cylinder Description: Moves the drive’s read/write head to the caller-specified cylinder. In modern systems, it is used primarily for testing the performance of the drive. Supports: Fixed disk only.
Non-Removable Media 6.2.9 32087C Function 0Dh - Alternate Disk Subsystem Reset Description: Reinitializes the fixed disk controller, resets the specified drive’s parameters, and recalibrates the drive’s heads (seek to track 0). Both the master and slave drives respond to the reset function. Supports: Fixed disk and floppy disk.
32087C 6.2.11 Non-Removable Media Function 11h - Recalibrate Drive Description: Issues a recalibrate ATA command to the fixed disk specified in the DL register and returns the status of the operation. Supports: XT, AT, PS/2 fixed disk only. Passed: Parameter Description AH 11h DL Drive number Returns: Parameter Description CF 0 = Success 1 = Failure AH Status code: See AH in "Function 01h - Get Disk Subsystem Status" on page 46 Special Instructions: None.
Non-Removable Media 6.2.13 32087C Function 15h - Get Disk Type Description: Returns the type of disk that applies to the caller’s DL register value. Supports: Fixed disk and floppy disk.
32087C 6.3 Non-Removable Media INT 13h Extensions API The functions in this section were defined by IBM in the document entitled, “INT 13h Extensions API” as an alternate mechanism for handling large IDE drives and to provide a uniform API for devices that support removable media.
Non-Removable Media 32087C 6.3.2.
32087C 6.3.3.2 Non-Removable Media Function 42h - Extended Read Sectors Description: Used to read zero or more blocks of data into host memory. If successful, Block_Count within the Disk_Address_Packet contains the number of sectors successfully transferred. Supports: Fixed disks only.
Non-Removable Media 6.3.3.4 32087C Function 44h - Extended Verify Sectors Description: Used to verify zero or more blocks of data into host memory. If successful, Block_Count within the Disk_Address_Packet contains the number of sectors successfully verified. Supports: Fixed disks only.
32087C 6.3.3.6 Non-Removable Media Function 48h - Extended Get Drive Parameters Description: Returns physical characteristics of the caller-specified drive. Supports: Fixed disks only. Passed: Parameter Description AH 48h DL Logical drive number (80h = drive 0, 81h = drive 1, etc.) DS:SI Far pointer to caller’s buffer to receive drive information structure Returns: Parameter Description CF 0 = Success 1 = Failure DS:SI AH Pointer to returned drive information structure, see Special (below).
32087C Non-Removable Media Table 6-2. info_flag Field Bit 15:7 6 Description Reserved: Must be set to zero by the implementor. 0 if CHS values are for the media that is currently in the drive (removable media only); values must be returned for the media if the media is in the drive. 1 if CHS values are fully supported by the drive (when there is no media in the drive). 5 0 if drive is not lockable. 1 if drive is lockable.
32087C 6.4 Non-Removable Media INT 13h ATA Device (Fixed Disk) Data Structures The lower 1 MB of RAM in a PC/AT compatible system contains a hodgepodge of “compatible” locations and data structures. Several of these locations are related directly to fixed disk support. 6.4.1 BIOS Data Area (BDA) Initially, the BIOS existed in ROM. It had no RAM to store information about the machine it was executing. For this reason, early BIOS designers chose to use a 256-byte region in lower RAM for themselves.
32087C Non-Removable Media Table 6-3.
32087C Non-Removable Media Table 6-3. Format of the BIOS Data Area (Continued) 64 Offset Size Description 42h1 7 BYTEs 49h BYTE Current video mode. 4Ah WORD Number of columns in current text page. 4Ch WORD Size of current video page in bytes. 4Eh WORD Current video page start address. 50h 16 BYTEs 60h WORD Video cursor type, 6845 compatible: MSB = Startline LSB = Endline 62h BYTE Video current page number.
32087C Non-Removable Media Table 6-3. Format of the BIOS Data Area (Continued) Offset Size Description 76h1 BYTE Head control byte (= 8 if head count > 8). 77h BYTE Reserved. 78h 3 BYTEs 79h BYTE 7Ch 4 BYTEs 80h WORD Keyboard buffer start location override (relative to 40:0h). 82h WORD Keyboard buffer end offset + 1 override (relative to 40:0h). 84h BYTE Maximum video text row. 85h WORD Height of EGA/MCGA/VGA character in scan lines. 87h BYTE Video EGA/VGA control byte.
32087C Non-Removable Media Table 6-3.
32087C Non-Removable Media 6.5 INT 41h/46h Vectors INT 41h and INT 46h are not interrupt vectors in the normal sense. Attempting to execute an INT 41h or INT 46h instruction is likely to crash the system immediately. These locations hold 32-bit segment:offset pointers to physical parameter tables for fixed disks 0 and 1, respectively. If the fixed disk count in location 40:75h is one, only the pointer in the INT 41h location (0:104h) is valid. If the value in 40:75h is two, both pointers are valid.
32087C 6.5.2 Non-Removable Media Enhanced Disk Drive Parameter Table The Enhanced Disk Drive (or EDD) table is backwardly compatible with the standard parameter table (described in Section 6.5.1 "Standard Disk Drive Parameter Table" on page 67). The preceding discussion (Section 6.5 "INT 41h/46h Vectors" on page 67) applies to this type of table as well as the standard IBM drive parameter table. Modern systems support the EDD table, which is a superset of IBM’s original table.
32087C Non-Removable Media 6.5.3 Fixed Disk Parameter Table Extensions In addition to determining the physical geometry of a fixed disk, it is useful to determine other fixed disk configuration parameters such as base I/O addresses, IRQ assignments, etc. For this reason, many newer system BIOS implementations support Fixed Disk Parameter Table Extensions (FDPTs).
32087C Non-Removable Media Table 6-4. Fixed Disk Parameter Table (FDPT) (Continued) Offset Size Description 0Ah BYTE Drive Description Byte: Bit 7 = If set, the system has been configured to perform DWORD-wide transfers for this drive. Otherwise, the system performs WORD-wide transfers to and from the drive. Bit 6 = If set, the drive is a CD-ROM device. Bit 5 = If set, the drive supports removable media. Bit 4 = If set, the system has configured the drive to operate in LBA mode.
32087C Non-Removable Media Operating System Block Device Driver layer Fixed Disk Parameter Table Extensions, Drive N Fixed Disk Parameter Table Extensions, Drive N-1 Fixed Disk Parameter Table Extensions, Drive 1 Address ? Fixed Disk Parameter Table Extensions, Drive 0 Address F000:E401h ROM-Based Tables for PC/AT Standard Drives INT 13h Standard Functions Address F000:xxxxh Function 08h: Get Drive Parameters INT 13h Function Extensions Function 41h: Check Extensions Present Function 48h: Ext.
32087C 72 Non-Removable Media AMD Geode™ GeodeROM Functional Specification
PCI Support 32087C 7 7.0PCI Support This chapter describes the support that GeodeROM provides for PCI device enumeration, configuration, and runtime access. PCI bus architecture is outlined in detail by the following documents: • PCI Local Bus Specification, revision 2.1 or newer • PCI BIOS Specification, revision 2.1 or newer • PCI IDE Specification, revision 1.0 • PCI-PCI Bridge Specification, revision 1.
32087C PCI Support Power-On PCI Device Configuration Support During its power-on sequence, GeodeROM assigns IRQs, I/O, and memory ranges to PCI adapters requesting such system resources. GeodeROM scans the PCI bus in ascending order. I/O and memory ranges are assigned in a “top-down” fashion, starting at FFFFh and FFE00000h, respectively. Assignment of PCI IRQ Channels The same IRQ channel is assigned to all PCI devices. It is expected that the operating system can share IRQ channels between devices.
32087C PCI Support 7.1 INT 1Ah, Function B1h PCI BIOS Subfunctions Descriptions GeodeROM supports real (INT 1Ah) and 32-bit protected mode access to the set of functions defined in revision 2.1 of the PCI BIOS Specification. This section lists those INT 16h Function B1h subfunctions supported in GeodeROM, the parameters that system software supplies to each subfunction, and the values that each function returns. 7.1.
32087C 7.1.2 PCI Support Subfunction 02h - Find PCI Device Description: Given a vendor ID, device ID, and an index N, the function Find PCI Device finds the Nth device or function whose vendor ID and device ID match those passed into the function. Additionally, Find PCI Device returns the bus number, device number, and function number of the device if it successfully finds a match. This function is useful for locating all PCI devices in the system that perform the same function.
32087C PCI Support 7.1.3 Subfunction 03h - Find PCI Class Code Description: The function Find PCI Class Code returns the Nth occurrence of the device or device function whose class code matches the value passed in the ECX register. The Find PCI Class Code function is useful for locating all system PCI devices that belong to the same device class. The first return value of DEVICE_NOT_FOUND indicates there are no more devices in the system with the specified class code.
32087C 7.1.4 PCI Support Subfunction 06h - Generate Special Cycle Description: The PCI host controller has the ability to broadcast messages across the entire bus by issuing special cycles. When a special cycle occurs, devices on the bus can monitor the message, but must not acknowledge the message by asserting their DEVSEL# (Device Select) signal. PCI devices do not have to respond to special cycles.
32087C PCI Support 7.1.
32087C 7.1.5.2 PCI Support Subfunction 09h - Read Config WORD Description: Reads one WORD from the configuration space of the caller-specified PCI device.
32087C PCI Support 7.1.5.4 Subfunction 0Bh - Write Config BYTE Description: Writes one BYTE to the configuration space of the caller-specified PCI device.
32087C 7.1.5.6 PCI Support Subfunction 0Dh - Write Config DWORD Description: Writes one DWORD to the configuration space of the caller-specified PCI device.
Serial Port BIOS Support 32087C 8 8.0Serial Port BIOS Support GeodeROM supports the standard INT 14h functions listed in Table 8-1 that pertain to the operation of up to four serial ports in the system. Table 8-1. INT 14h Functions Function Number/Name Page Number Function 00h - Initialize Port 83 Function 01h - Write Character to Port 85 Function 02h - Read Character from Port 85 Function 03h - Get Port Status 86 8.
32087C AL Port parameters: Bits [7:5] - Data rate: 000 = 110 bps 001 = 150 bps 010 = 300 bps 011 = 600 bps 100 = 1200 bps 101 = 2400 110 = 4800 111 = 9600 Bits [4:3] - Parity: 00 = None 10 = None 01 = Odd 11 = Even Bit 2 - Stop bit: 0= Clear 1= Set Bits [1:0] - Data size; character length: 00 = 5 01 = 6 10 = 7 11 = 8 DX Port number; BDA location: 00h = 40:0h 01h = 40:2h 02h = 40:4h 03h = 40:6h Serial Port BIOS Support Returns: Parameter 84 Description AH Line status: Bit 7 = Timeout error occurred
Serial Port BIOS Support 8.1.2 32087C Function 01h - Write Character to Port Description: Sends a character of data to the serial port.
32087C 8.1.4 Serial Port BIOS Support Function 03h - Get Port Status Description: Reports the status of the serial port. Most of the function reports errors, however, it can be used to check whether data is available for reading (Data Ready flag, AH = 0).
Parallel Port BIOS Support 32087C 9 9.0Parallel Port BIOS Support GeodeROM supports the standard INT 17h functions listed in Table 9-1 that pertain to the operation of up to three parallel ports in the system: Table 9-1. INT 17h Functions Function Number/Name Page Number Function 00h - Print a Character 87 Function 01h - Initialize Parallel Port 88 Function 02h - Get Port Status 88 9.
32087C 9.1.2 Parallel Port BIOS Support Function 01h - Initialize Parallel Port Description: Resets the printer and sets the top of the page to the current position of the paper by sending control codes 08h and 0Ch. Passed: Parameter Description AH 01h DX Port number: See "Function 00h - Print a Character" on page 87 Returns: Parameter AH 9.1.
Human Interface Device Support 32087C 10 10.0Human Interface Device Support This chapter describes GeodeROM’s support for human interface devices (HID), such as keyboards and pointing devices. GeodeROM provides full support for 101 key PC keyboards. It contains a full implementation of the INT 16h interface as described in numerous books on the subject of low level PC programming.
32087C 10.1.2 Human Interface Device Support Function 01h - Check For Key Present Description: Checks the keyboard buffer to determine whether a keystroke is available. The keystroke is not removed from the keyboard buffer. Passed: Parameter AH Description 01h Returns: Parameter AH Description Scan code AL Character ZF 00h if character in buffer 01h if no character in buffer Related Functions: INT 16h "Function 11h - Check For Enhanced Key Code" on page 92. 10.1.
32087C Human Interface Device Support 10.1.4 Function 03h - Set Keyboard Typematic Rate Description: Operating system modifiable typematic delay and rate. Passed: Parameter BH Description Delay value in milliseconds: 00h = 250 msec 01h = 500 msec 02h = 750 msec 03h = 1000 msec 04h to 0FFH = Reserved BL Typematic Rate (characters per second): No other values are supported. 00h = 30.0 01h = 26.7 02h = 24.0 03h = 21.8 04h = 20.0 05h = 18.5 06h = 17.1 07h = 16.0 08h = 15.0 09h = 13.3 0Ah = 12.
32087C 10.1.6 Human Interface Device Support Function 10h - Get Extended Key Code Description: Returns after a keystroke (including non-standard keys) occurs. Passed: Parameter AH Description 10h Returns: Parameter Description AH Scan code AL Character Related Functions: INT 16h "Function 00h - Wait For Character" on page 89. 10.1.7 Function 11h - Check For Enhanced Key Code Description: Checks the keyboard buffer to determine whether a keystroke is available.
Human Interface Device Support 10.1.8 32087C Function 12h - Get Extended Shift Status Description: Returns the state of the Left Shift, Right Shift, Ctrl, and Alt keys. It also indicates the state of the ScrollLock, NumLock, CapsLock, and Insert keys. Additionally, the states of other keys are returned.
32087C 94 Human Interface Device Support AMD Geode™ GeodeROM Functional Specification
System Time and Date 32087C 11 11.0System Time and Date GeodeROM supports a majority of the standard system functions listed in Table 11-1. Table 11-1.
32087C System Time and Date Returns: Parameter Description CX The most significant two bytes of the 4-byte count DX The least significant two bytes of the 4-byte count AL Rollover value, nonzero if midnight has passed since the last time the count was read Related Functions: INT 1Ah "Function 01h - Set System Time" on page 96. INT 1Ah "Function 02h - Get Real-Time Clock Time Status" on page 96. 11.1.
System Time and Date 11.1.4 32087C Function 03h - Set Real-Time Clock Time Description: Sets the time value stored in the system’s real-time clock, in the form of hours, minutes, and seconds.
32087C 11.1.6 System Time and Date Function 05h - Set Real-Time Clock Date Description: Sets the date that is stored in the system’s real-time clock. Passed: Parameter Description AH 05h CH The century of the current date, in BCD, stored in the RTC CL The year of the current date, in BCD, stored in the RTC DH The month of the current date, in BCD, stored in the RTC DL The day of the current date, in BCD, stored in the RTC Returns: None.
System Time and Date 11.1.9 32087C Function 09h - Get Real-Time Clock Alarm Status Description: Sets the alarm in the system’s real-time clock. The alarm occurs every 24 hours, causing an INT 4Ah, until it is disabled.
32087C System Time and Date Returns: Parameter Description CF 0 = Success 1 = Failure Related Functions: INT 1Ah "Function 05h - Set Real-Time Clock Date" on page 98. INT 1Ah "Function 0Ah - Read System Day Counter" on page 99. 11.1.12 Function 0Eh - Get Real-Time Clock Date/Time Alarm and Status Description: Returns settings for the RTC alarm.
System Services 32087C 12 12.0System Services GeodeROM supports INT 15h for certain standard system services (listed in Table 12-1). This section describes the interfaces for those services. INT 15h is used for Advanced Power Management (APM). See Section 17.0 "Power Management" on page 239 for details. It is also used for backward compatibility with AMD’s Virtual System Architecture™ (VSA) technology.: Table 12-1.
32087C System Services Table 12-1. INT 15h System Services Support Functions (Continued) Function Subfunction Page Number Function 87h - Extended Memory Block Move 126 Function 88h - Get Extended Memory Size 127 Function 89h - Enter Protected Mode 127 Function 90h - Device Busy 128 Function 91h - Interrupt Complete 129 Function BEh - AMD OEM Functions 130 Subfunction 00h - Read ACCESS.bus Byte 131 Subfunction 01h - Write ACCESS.bus Byte 131 Subfunction 02h - Write ACCESS.
32087C System Services Table 12-1.
32087C 12.1.1.2 System Services Subfunction 01h - Enable A20 Gate Description: Enables the A20 functionality. Passed: Parameter Description AH C0h AL 01h Returns: Parameter Description CF 0 = Success 1 = Failure AH 00h if successful 01h if keyboard is in secure mode Related Functions: None. 12.1.1.3 Subfunction 02h - Get A20 Gate Status Description: Retrieves the current status of A20 gate.
32087C System Services 12.1.1.4 Subfunction 03h - A20 Support Description: Passed: Parameter Description AH 24h AL 03h Returns: Parameter Description CF 0 AX 0000h BX 0002h Related Functions: None. 12.1.2 Function 4Fh - Key Scan Hook Description: Passed: Parameter AH Description 4Fh Returns: Parameter CF Description 1 Related Functions: None.
32087C 12.1.3 System Services Function 53h 12.1.3.
32087C System Services 12.1.3.
32087C 12.1.3.3 System Services Subfunction 02h - APM Protected Mode 16-Bit Interface Connect Description: Establish 16-bit protected mode connection. Returns with error status if the 16-bit connect is already active or if a 16bit protected mode entry is not supported. If not connected, set a flag in PM memory to indicate the 16-bit connect and return parameters. All general purpose registers may be modified except EBP and ESP.
32087C System Services 12.1.3.4 Subfunction 03h - APM Protected Mode 32-Bit Interface Connect Description: Establish 32-bit protected mode connection. Returns with error status if the 32-bit connect is already active or if a 32bit protected mode entry is not supported. If not connected, set a flag in PM memory to indicate the 32-bit connect and return parameters. All general purpose registers may be modified except EBP, ESP.
32087C 12.1.3.5 System Services Subfunction 04h - APM Interface Disconnect Description: Record connect/engaged status.
32087C System Services 12.1.3.6 Subfunction 05h - CPU Idle Description: Passed: Parameter Description AH 53h = APM AL 05h = APM function code Returns: Parameter Description If function is successful: CF 0 = Successful connection If function is unsuccessful: CF 1 = Carry flag set on error AH Error code: 03h = Interface not connected 0Bh = Interface not engaged Related Functions: None. 12.1.3.
32087C 12.1.3.8 System Services Subfunction 07h - Set Power State Description: Passed: 1. 2. 3.
32087C System Services 12.1.3.9 Subfunction 08h - Enable/Disable Power Management Description: Passed: 1. Parameter Description AH 53h = APM AL 08h = APM function code BX Power device ID: 0001h = All devices power managed by APM BIOS FFFFh1 = All devices power managed by APM BIOS All other values reserved Must be implemented for compatibility with APM 1.0.
32087C 12.1.3.10 System Services Subfunction 09h - Restore APM BIOS Power On Description: Passed: 1. Parameter Description AH 53h = APM AL 09h = APM function code BX Power device ID: 0001h = All devices power managed by APM BIOS FFFFh1 = All devices power managed by APM BIOS All other values reserved Must be implemented for compatibility with APM 1.0.
32087C System Services 12.1.3.
32087C 12.1.3.12 System Services Subfunction 0Bh - Get PM Event Description: Passed: Parameter Description AH 53h = APM AL 0Bh = APM function code Returns: Parameter Description If function is successful: CF 0 = Successful connection BX PM event code CX PM event information If function is unsuccessful: CF 1 = Carry flag set on error AH Error code: 03h = Interface not connected 0Bh = Interface not engaged 80h = No power management events pending Related Functions: None.
32087C System Services 12.1.3.13 Subfunction 0Ch - Get Power State Description: Passed: 1. Parameter Description AH 53h = APM AL 0Ch = APM function code BX Power device ID: 0001h = All devices power managed by APM BIOS 01xxh1 = Display 02xxh = Secondary storage 03xxh = Parallel ports 04xxh = Serial ports 05xxh = Network adapters 06xxh = PCMCIA sockets E000h-EFFFH = OEM defined power device IDs All other values reserved xxh = Unit number (0 based).
32087C 12.1.3.14 System Services Subfunction 0Dh - Enable/Disable Device Power Management Description: Passed: 1.
32087C System Services 12.1.3.
32087C 12.1.3.16 System Services Subfunction 0Fh - Engage/Disengage Power Management Description: Passed: 1.
32087C System Services 12.1.3.
32087C 12.1.3.
32087C System Services 12.1.3.
32087C 12.1.3.
32087C System Services 12.1.4 Function 86h - BIOS Wait Description: Passed: Parameter Description AH 86h CX CX:DX = Interval in microseconds DX 0000h = Disable resume on ring indicator 00001h = Enable resume on ring indicator 0002h = Get enabled/disabled status All other values are reserved Returns: Parameter CF Description 0 = Carry flag cleared Related Functions: None.
32087C 12.1.5 System Services Function 87h - Extended Memory Block Move Description: Puts the system into protected mode and copies memory from one location to another. The intent is to move data or code into an area not easily reached by a real mode program.
32087C System Services 12.1.6 Function 88h - Get Extended Memory Size Description: Returns the amount of memory, above 1 MB, in the system. The nature of this interface limits it to reporting 65 MB total in the system.
32087C System Services Table 12-2. Global Descriptor Table (GDT) Offset Size Description 00h 8 BYTEs Zeros (null descriptor) 08h 8 BYTEs GDT descriptor: See Table 12-3. 10h 8 BYTEs IDT descriptor 18h 8 BYTEs DS descriptor 20h 8 BYTEs ES descriptor 28h 8 BYTEs SS descriptor 30h 8 BYTEs CS descriptor 38h 8 BYTEs Uninitialized, used to build descriptor for BIOS CS Descriptor Table 12-3.
32087C System Services 12.1.9 Function 91h - Interrupt Complete Description: Passed: Parameter Description AH 91h CX CX:DX = Interval in microseconds DX 0000h = Disable resume on ring indicator 00001h = Enable resume on ring indicator 0002h = Get enabled/disabled status All other values are reserved Returns: Parameter CF Description 0 = Carry flag cleared Related Functions: None.
32087C System Services 12.1.10 Function BEh - AMD OEM Functions The AMD OEM functions can be broadly divided into the following categories: • ACCESS.bus Access Functions Specific to Geode™ Devices: — GeodeROM provides the following functions to access ACCESS.bus devices installed in the system. These can be used in platform-specific modules or when writing tools and utilities. — ACCESS.bus access functions specific to Geode devices, INT 15h, Function BEh: – Subfunction 00h: Read ACCESS.
32087C System Services 12.1.10.1 Subfunction 00h - Read ACCESS.bus Byte Description: Read a byte of data from an ACCESS.bus device. Passed: Parameter Description AX BE00h BX 4E53h (= ‘NS’) CL Register offset CH ACCESS.bus address Returns: Parameter Description CF 0 = Success 1 = Failure AL Data read Related Functions: None. 12.1.10.2 Subfunction 01h - Write ACCESS.bus Byte Description: Write a byte of data to an ACCESS.bus device.
32087C 12.1.10.3 System Services Subfunction 02h - Write ACCESS.bus Block Description: Write a byte of data to an ACCESS.bus device. Passed: Parameter Description AX BE00h BX 4E53h (= ‘NS’) CL Register offset CH ACCESS.bus address DL Number of bytes to transfer DS:SI Pointer to transfer buffer Returns: Parameter Description CF 0 = Success 1 = Failure Related Functions: None. 12.1.10.
32087C System Services Returns: Parameter Description CF 0 = Success 1 = Failure DL Value read, or error code: Error Codes: 00h = Reserved 01h = Token not supported 02h = Software support not present (e.g., not implemented) 03h = Hardware support not present (e.g., no CMOS in system) 04h = Invalid media specified 05h = Token not valid in particular media Related Functions: None. 12.1.10.5 Subfunction 04h - Write NVRAM Data Description: Write data associated with a particular token to NVRAM.
32087C 12.1.10.6 System Services Subfunction 05h - Get Default NVRAM Value Description: Retrieves the default setting for a particular token. SeeTable 12-4 on page 136 for the format of the tokens.
32087C System Services 12.1.10.8 Subfunction 07h - Set NVRAM Checksum Description: Calculates the checksum for NVRAM and stores at the location for the checksum token. Passed: Parameter Description AX BE07h BX 4E53h (= ‘NS’) DH Media: See "Subfunction 03h - Read NVRAM Data" on page 132 Returns: Parameter Description CF 0 = Success 1 = Failure DL Error code if failure: See "Subfunction 03h - Read NVRAM Data" on page 132 Related Functions: None. 12.1.10.
32087C System Services 12.1.10.10 Subfunction 09h - Get NVRAM Table Address Description: Returns the address for the NVRAM and media type tables, and is intended for internal usage. Passed: Parameter Description AX BE09h BX 4E53h (= ‘NS’) Returns: Parameter Description SI Address of NVRAM map CX Number of entries in NVRAM map DI Address of media table DX Number of entries in NVRAM (see Table 12-4 "NVRAM Table") Related Functions: None. Table 12-4.
32087C System Services Table 12-4. NVRAM Table (Continued) Token1 Description Width Definition TV Video timeout 1 Byte See “Standby timeout” (TY, this table) TU Serial port timeout 1 Byte See “Standby timeout” (TY, this table) TP Parallel port timeout 1 Byte See “Standby timeout” (TY, this table) W1 Wakeup mask PIC1 1 Byte Bit mask: Bit 0 = IRQ0, etc. W2 Wakeup mask PIC2 1 Byte Bit mask: Bit 0 = IRQ8, etc.
32087C System Services Table 12-4. NVRAM Table (Continued) Token1 Description Width Definition LD LPT1 mode 3 Bits 000 = Compatible 001 = PS/2 bidirectional 010 = EPP 1.7 011 = EPP 1.9 100 = ECP 101-111 = Reserved LB LPT2 I/O port 2 Bits 00 = Disable 01 = 378 10 = 278 11 = 3BC LQ LPT2 IRQ (only used when necessary, depending on port mode) 2 Bits 00 = IRQ5 01 = IRQ7 10-11 = Reserved LO LPT2 mode 3 Bits 000 = Compatible 001 = PS/2 bidirectional 010 = EPP 1.7 011 = EPP 1.
32087C System Services Table 12-4.
32087C System Services Table 12-4. NVRAM Table (Continued) Token1 140 Description Width Definition MR SDRAM clock ratio 3 Bits 000 = Reserved 001 = 2.0 010 = 2.5 011 = 3.0 100 = 3.5 101 = 4.0 110 = 4.5 111 = 5.0 MD SDRAM drive/slew 3 Bits 000 = Lowest drive strength 001… 111 = Highest drive strength MS SDRAM shift SDCLK 3 Bits 000 = No shift 001 = Shift 0.5 core clocks 010 = Shift 1.0 core clocks 011 = Shift 1.5 core clocks 100 = Shift 2.0 core clocks 101 = Shift 2.
32087C System Services Table 12-4. NVRAM Table (Continued) Token1 1.
32087C System Services 12.1.10.11 Subfunction 0Ah - ACCESS.bus Block Read Description: Reads a block of data from an ACCESS.bus device. Sends an offset/command byte so it only works with devices that expect an address followed by an offset/command followed by a read of data. For devices that do not require an offset/ command, use the special procedure (BE31h). Not valid for none ACCESS.bus systems (i.e., AMD Geode™ SC1100, SC1200, SC1201, SC2200, and SC3200 processors with ACCESS.
32087C System Services 12.1.10.12 Subfunction 20h - Get SCxxxx External Clock Speed Description: Returns the value of the single chip device’s clock speed in MHz. Passed: Parameter Description AX BE20h BX 4E53h (= ‘NS’) Related Functions: None. Returns: Parameter Description AX Clock speed (MHz) CF 0 = Success 1 = Failure 12.1.10.13 Subfunction 21h - Get SCxxxx Device Type Description: Returns the value of the single chip device’s number in the system (i.e.
32087C System Services 12.1.10.14 Subfunction 31h - SCxxxx Read ACCESS.bus Device Description: Read a byte of data from an ACCESS.bus device when a single chip device is used in the system (i.e., SC1100, SC1200, SC1201, SC2200, SC3200).
32087C System Services Returns: Parameter Description CF 0 if operation completed successfully 1 if operation failed; error reported in AH AH Error code: 01h = Invalid size 02h = ACCESS.bus COM error 03h = Buffer address wrap Related Functions: None. 12.1.10.16 Subfunction 35h - Owl Board Specific Feature Access Description: Provides access to the features on the Owl board.
32087C System Services 12.1.10.17 Subfunction A0h - Wait for Key Timeout Description: Calls waitForKeyTimeout. Does not EAT the key. Use I15EatKey (BEAC). Passed: Parameter Description AX BEA0h BX 4E53h (= ‘NS’) ECX Contains maximum number of mSec to wait for a key press before continuing. Returns: Parameter Description AX Holds key pressed or 0 if timeout. CF 0 = Success 1 = Failure Related Functions: None.
32087C System Services 12.1.10.18 Subfunction A1h - Get ROM Data Description: Returns a pointer to the ROM data. The address is returned in DX:AX.
32087C System Services 12.1.10.19 Subfunction A2h - CPU Memory Register Read Int Description: Read a memory mapped offset from GX_BASE. This function is not defined in the Geode GX processor BIOS and returns a 0 (success) in CF. Passed: Parameter Description AX BEA2h BX 4E53h ( = ‘NS’ ECX Register offset from GX_BASE Returns: Parameter Description EDX Register data CF 0 = Success 1 = Failure Related Functions: None. 12.1.10.
32087C System Services 12.1.10.21 Subfunction A4h - Get CPU Speed Description: Calculate and return the speed of the CPU. Passed: Parameter Description AX BEA4h BX 4E53h (=’NS’) Returns: Parameter Description AX CPU Speed in MHz CF 0 = Success 1 = Failure Related Functions: None. 12.1.10.22 Subfunction A5h - Check CMOS Description: Check for the presence of CMOS by writing test pattern to b[1:0] of the diagnostic byte.
32087C System Services 12.1.10.23 Subfunction A6h - Check CMOS Power Description: Check whether CMOS has lost power. Passed: Parameter Description AX BEA6h BX 4E53h (= ‘NS’) Returns: Parameter CF Description 0 = Power good 1 = Power lost Related Functions: None. 12.1.10.24 Subfunction A7h - Get PCI Speed Description: Detect and return the PCI bus speed.
32087C System Services 12.1.10.25 Subfunction A8h - Set Warning Description: Set a summary screen warning with a string located at CX:DX. The system may contain up to three warning messages. If three already exist, this function places the warning in the third location. Passed: Parameter Description AX BEA8h BX 4E53h (= ’NS’) CX Segment of warning string DX Offset of warning string Returns: Parameter Description CF 0 = Success 1 = Failure Related Functions: None. 12.1.10.
32087C System Services 12.1.10.27 Subfunction AAh - CPI Register Read Description: Read a Geode GX1 processor configuration register from the index/data pair at 22h/23h. Executing this interrupt has no function on a Geode GX processor but will return success. See the AMD Geode™ GX1 Processor Data Book for a list of configuration registers that may be read.
32087C System Services 12.1.10.29 Subfunction ACh - Eat Key Description: Calls EatKey. Not used in Geode GX processor. Passed: Parameter Description AX BEACh BX 4E53h (= ‘NS’) Returns: Parameter Description AX Keystroke CF 0 = Success 1 = Failure Related Functions: None. 12.1.10.30 Subfunction B0h - Get Shadow Description: Read the shadow information for each of the 16 KB regions from C0000h through FC000h. This call is only supported on Geode GX processor systems.
32087C System Services 12.1.10.31 Subfunction B1h - Set Shadow Description: Write the shadow information for each of the 16 KB regions from C0000h through FC0000h. This call is only supported on Geode GX processor systems. On anything else it returns with an indication of unsuccessful.
32087C System Services 12.1.11 Function C0h - Get ROM Configuration Description: The ROM holds information about the system’s design. This function retrieves a pointer to the data.
32087C System Services 12.1.13 Function C2h - PS/2 Mouse Support GeodeROM provides support for detecting, initializing and handling PS/2 mouse activity. For information on PS/2 mouse support, refer to the IBM Mouse Technical Reference Manual.
32087C System Services 12.1.13.2 Subfunction 01h - Reset Pointing Device Description: Resets the pointing device: IRQ 12 is unmasked, the interface is disabled, the pointing device is reset (command FFh), and if found successfully, bit 4 of the equipment determination WORD in the BDA (40:10) is set.
32087C 12.1.13.4 System Services Subfunction 03h - Set Resolution Description: Sets the resolution for the pointing device. Sending the E8h command to the device, followed by the resolution value, sets the resolution.
32087C System Services 12.1.13.6 Subfunction 05h - Initialize Pointing Device Interface Description: Initializes the pointing device interface flags by clearing the Acknowledge bit (bit 5) in the Extended BDA (offset 26h) and setting the package size (bits 0-3 in the EBDA offset 27h). Passed: Parameter AH Description C205 Returns: Parameter Description CF 0 = Success 1 = Failure AH Status code: See "Subfunction 00h: - Enable/Disable Pointing Device" on page 156 Related Functions: None. 12.1.13.
32087C 12.1.13.8 System Services Subfunction 07h - Set Pointing Device Handler Address Description: Allows the caller to set the address for the handler. The vector is stored in the Extended BDA at offset 22h, and the driver flag is set in Offset 27h.
32087C System Services 12.1.14.2 Subfunction 20h - Get System Memory Map Description: Reports a memory map of the memory installed in the system. Data is in the form of table entries.
32087C 162 System Services AMD Geode™ GeodeROM Functional Specification
Video BIOS Support 32087C 13 13.0Video BIOS Support GeodeROM’s supports the INT 10h video BIOS functions listed in Table 13-1 and VESA BIOS Extension in Section 13.2 on page 192. Table 13-1.
32087C Video BIOS Support Table 13-1.
32087C Video BIOS Support 13.1 INT 10h Functions Descriptions This section lists those INT 10h functions supported in GeodeROM, the parameters that system software supplies to each INT10h function, and the values that each function returns. 13.1.1 Function 00h - Set Video Mode Description: Sets the VGA into one of several enumerated modes. A “normal” mode set includes clearing the display memory; however, by setting bit 7 of AL to a “1” allows the mode set to occur without clearing video memory.
32087C 13.1.2 Video BIOS Support Function 01h - Set Cursor Type Description: Changes the shape of the text mode cursor to a new start and end scan line shape. By setting the cursor start scan line greater than the cell height on the screen, the text cursor is disabled (hidden). The standard method of disabling the cursor is to pass a 20h as the start scan line value. This function has no effect in graphics mode.
32087C Video BIOS Support 13.1.4 Function 03h - Get Cursor Position Description: Returns the current cursor start and end scan line as well as the current cursor position. Note that the cursor position is based on the page passed, but the cursor type (start and end scan lines) is global across all video pages. Passed: Parameter Description AH 03h BH Page number (0 for graphics modes) DS Seg0 Returns: Parameter Description DH Column DL Row 13.1.
32087C 13.1.6 Video BIOS Support Function 05h - Set Active Display Page Description: Sets the displayable video memory to a new page. The number of video pages available are mode dependent. The higher resolution and extended modes use only one video page (page 0). Mode 00h/01h 02h/03h 07h 0Dh 0Eh 0Fh/10h All others Pages 8 8 8 8 4 2 0 Passed: Parameter Description AH 05h DS Seg0 AL xxh = Page to set to Returns: None. 13.1.
32087C Video BIOS Support 13.1.8 Function 07h - Scroll Down Description: Causes a specified rectangular area of the screen to move down a given number of lines. The remaining rows at the top of the area are cleared with a given fill attribute. The data outside of this area is unaffected. This function only operates on the active page. Setting the number of lines to scroll to a zero (“0”) causes the entire area to be cleared with the fill attribute.
32087C Video BIOS Support 13.1.10 Function 09h - Write Character and Attribute Description: Writes a character with a given attribute at the location specified by the current cursor position. In graphics mode, the attribute is actually the foreground color (background is always black). Also in graphics modes, if bit 7 of BL is set to a “1”, then the character is XORed into memory. The number of characters written (specified by CX) should not exceed the screen length.
32087C Video BIOS Support 13.1.12 Function 0Bh - Set CGA Palette Description: Sets the VGA palette as if the 6845 palette existed. It is provided for backward compatibility with the CGA. Applications aware of the EGA or VGA should use Function 10h to access the palette. When BH = 0, the background color and overscan is set.
32087C Video BIOS Support 13.1.14 Function 0Dh - Read Dot Description: Returns the color of the pixel at the specified location in graphics mode. This function has no effect in text mode. Passed: Parameter Description AH 0Dh DS Seg0 AL Pixel color BH Page CX Column DX Row Returns: None. 13.1.15 Function 0Eh - Write TTY Description: Writes a character to the display at the current cursor position. The cursor position is updated to the next available position.
32087C Video BIOS Support 13.1.16 Function 0Fh - Get Mode Description: Returns the current mode number, the number of columns on the screen, and the active display page. Bit 7 of AL returns the memory clear flag as passed to the previous call to set mode. Passed: Parameter AH Description 0Fh Returns: None. Returns: Parameter Description AL Current mode AH Number of columns BH Active page 13.1.17 Function 10h - Palette Handler Operates the interface to the internal palette and RAMDAC. 13.1.17.
32087C Video BIOS Support 13.1.17.3 Subfunction 02h: Set All Palette and Overscan Registers Description: Sets the palette to the values pointed to by ES:DX. The first 16 bytes in the buffer are the palette and the last byte is the overscan value. Passed: Parameter AH AL ES:DX Description 10h 02h Pointer to 17 byte table: Byte 16 = Overscan Bytes[15:0] = Palette Returns: None. 13.1.17.
32087C Video BIOS Support 13.1.17.6 Subfunction 08h: Read Overscan Register Description: Returns the current value of the Overscan register. Overscan is the small border around the edge of the screen between display end and blank start. Passed: Parameter Description AH 10h AL 08h Returns: Parameter BH Description Value read 13.1.17.
32087C Video BIOS Support 13.1.17.9 Subfunction 12h: Set Block of RAMDAC Registers Description: Sets a block of RAMDAC registers to the values pointed to by ES:DX. This buffer should contain a sequence of red, green, and blue values to be placed in the RAMDAC, starting at the specified index. The value in CX is not the length of the buffer, but the number of registers to set. The buffer is actually three times the number of bytes specified in CX.
32087C Video BIOS Support Returns: Parameter Description CH Green value CL Blue value DH Red value 13.1.17.12Subfunction 17h: Get Block of RAMDAC Registers Description: Gets a block of RAMDAC registers into a buffer pointed to by ES:DX. After the call, this buffer contains a sequence of red, green, and blue values from the RAMDAC, starting at the specified index. The value in CX is not the length of the buffer, but the number of registers to get.
32087C Video BIOS Support 13.1.17.14Subfunction 1Bh: Sum RAMDAC to Gray Scale Description: Converts a range of color registers into a gray scale. The shade of gray is based on 30% red, 59% green, and 11% blue. Passed: Parameter AH Description 10h AL 1Bh BX Starting index CX Number of registers to sum Returns: None. 13.1.18 Function 11h - Font Functions Operates the interface to the VGA loadable fonts. 13.1.18.
32087C Video BIOS Support 13.1.18.2 Subfunction 01h: Load 8x14 Font Description: Loads the ROM 8x14 font into the specified block. The font is loaded without changing the cell height or cursor size. If the cell height needs to be changed, use Subfunction 11h to adjust the CRTC values. Eight different font blocks can be loaded, but only two can be displayed at any one time. Passed: Parameter Description AH 11h AL 01h BL Font block Returns: None. 13.1.18.
32087C Video BIOS Support 13.1.18.5 Subfunction 04h: Load 8x16 Font Loads the ROM 8x16 font into the specified block. The font is loaded without changing the cell height or cursor size. If the cell height needs to be changed, use Subfunction 14h to adjust the CRTC values. Eight different font blocks can be loaded, but only two can be displayed at any one time. Passed: Parameter Description AH 11h AL 04h BL Font block Returns: None. 13.1.18.
32087C Video BIOS Support 13.1.18.7 Subfunction 11h: Load 8x14 Font with Fixup Loads the 8x14 font and adjusts the cell height, cursor size, and vertical resolution. If the cell height does not need to be changed, use Subfunction 01h. Eight different font blocks can be loaded, but only two can be displayed at any one time. Passed: Parameter Description AH 11h AL 11h BL Font block Returns: None. 13.1.18.
32087C Video BIOS Support 13.1.18.10Subfunction 20h: Load Upper 8x8 Graphics Character Set Sets the INT 1Fh vector to the pointer passed in ES:BP. This font pointer is only used in modes 4, 5 and 6 for the upper half (character 128-255) of the character set. The font pointer at the INT 1Fh vector is valid until the next mode set or the next call to this subfunction. Passed: Parameter Description AH 11h AL 20h ES:BP Pointer to font Returns: None. 13.1.18.
32087C Video BIOS Support 13.1.18.12Subfunction 22h: Load 8x14 Graphics Character Set Sets the INT 43h vector to a pointer to the 8x14 ROM font. This font pointer is used to draw all characters in graphics modes except modes 4, 5, 6 which only use the lower 128 characters of this table. The pointer to the upper half of the font for modes 4, 5, 6 is located at the INT 1Fh vector. The font pointer at the INT 43h vector is valid until the next mode set or the next call to load a graphics character set.
32087C Video BIOS Support 13.1.18.14Subfunction 24h: Load 8x16 Graphics Character Set Sets the INT 43h vector to a pointer to the 8x16 ROM font. This font pointer is used to draw all characters in graphics modes except modes 4, 5, 6 which only use the lower 128 characters of this table. The pointer to the upper half of the font for modes 4, 5, 6 is located at the INT 1Fh vector. The font pointer at the INT 43h vector is valid until the next mode set or the next call to load a graphics character set.
32087C Video BIOS Support 13.1.19 Function 12h: Alternate Select Functions Operates the interface to a variety of miscellaneous functions. 13.1.19.1 Subfunction 10h: Return Video Information Returns additional information about the adapter mode that is not available in Function 0Fh. This function was introduced with the EGA, and was a common method of detecting an EGA in the system.
32087C Video BIOS Support 13.1.19.3 Subfunction 30h: Select Scan Lines Sets the number of scan lines to be used in text mode to either 200, 350, or 400 lines. This setting takes effect on the next mode set. Only text modes are affected by this function; graphics modes remain at the same resolution regardless of this setting. Only modes 0, 1, 2, 3 can set a 200 scan line mode; mode 7 can only be set to 350 or 400 scan lines.
32087C Video BIOS Support 13.1.19.5 Subfunction 32h: Enable/Disable Video Subsystem Enables or disables the video subsystem. All I/O and memory accesses are affected. Passed: Parameter Description AH 12h AL Enable subsystem flag: 0 = Enable 1 = Disable BL 32h Returns: Parameter AL Description 12h 13.1.19.6 Subfunction 33h: Enable/Disable Summing to Gray Scales Causes all RAMDAC operations to load “as is” or to sum the color values to a shade of gray.
32087C Video BIOS Support Passed: Parameter Description AH 12h AL Enable emulation flag: 0 = Enable 1 = Disable BL 34h Returns: Parameter AL Description 12h 13.1.19.8 Subfunction 35h: Display Switch Switches between an adapter VGA and a motherboard (planar) VGA on the IBM PS/2 Model 30. Subfunctions 02h and 03h are valid only after Functions 00h and 01h have been called.
32087C Video BIOS Support 13.1.20 Function 13h - Write String Description: Sends a string to the display using the same TTY side-effects as Function 0Eh. With string types of AL = 2 and AL = 3, the TTY control commands are not followed by an attribute since they are not printable characters. Several control characters have an effect on the cursor position without writing an actual character to the display. The bell character (ASCII 07h) beeps the speaker once without changing the cursor position.
32087C Video BIOS Support 13.1.21 Function 1Ah - Get DCC Information Description: Sets or returns the display combination code (DCC). A DCC is used to indicate a combination of two monitors in the system. For example, a common combination is VGA color with a co-resident monochrome display adapter. This function was not on the EGA and therefore has been used as a test for the existence of a VGA in the system.
32087C Video BIOS Support 13.1.22 Function 1Bh - Get Functionality Information Description: Returns a wealth of information about the VGA’s capabilities and about the current mode setting. Passed: Parameter Description AH 1Bh = Function number DS Seg0 BX 0 ES:DI Point to target buffer (size = 40h bytes) Returns: Parameter AL Description 1Bh 13.1.23 Function 1Ch - Save Restore State Description: Video BIOS functionality/state information.
32087C 13.2 Video BIOS Support VESA BIOS Extended Functions This subsection is based on the VESA BIOS Extensions (VBE) Specification Version 2.0. Applications use VBEs to get information about a video controller and then setup an environment in which the application program can work.
32087C Video BIOS Support Table 13-4.
32087C 13.2.2 Video BIOS Support Function 01h: Return VBE Mode Information Description: Returns information about the specified video mode. The information is stored in the VBEModeInfoBlock data structure. Passed: Parameter Description AH 4Fh AL 01h CX Mode number ES:DI Pointer to 256-byte buffer Returns: Parameter AX 13.2.3 Description VBE return status Function 02h: Set VBE Mode Description: Sets an extended video mode.
32087C Video BIOS Support Returns: Parameter Description AX VBE return status BX Mode: Bits[13:0] = Mode number Bit[14] = Linear frame buffer flag Bit[15] = Don’t clear memory flag 13.2.5 Function 04h: VBE Save/Restore State This function saves or restores the state of the video controller. Note that this function call is a superset of the Standard VGA BIOS Function 1Ch. Just like Function 1Ch, there are three subfunctions: 13.2.5.
32087C Video BIOS Support 13.2.5.3 Subfunction 02h: Restore State Description: Restores the state of the video controller. The value in CX is a bit field where each bit corresponds to a section of the video controller to restore. Note that on a restore state, this value must be the same as the save state that originally filled the save buffer.
32087C Video BIOS Support 13.2.6.2 Subfunction 01h: Get Bank Passed: Parameter Description AH 4Fh AL 05h DL 01h BL Window number: 0 = Window A 1 = Window B Returns: Parameter Description AX VBE return status DX Bank number 13.2.7 Function 06h: VBE Set/Get Logical Scan Line Length The subfunctions either set or get the logical scan line length (sometimes referred to as “row offset”). The logical scan line length can be set greater than or equal to the displayed scan line length.
32087C Video BIOS Support Returns: Parameter Description AX VBE return status BX Bytes per scan line CX Actual pixels per scan line (truncated to nearest) DX Maximum number of scan lines 13.2.7.
32087C Video BIOS Support 13.2.8 Function 07h: VBE Set/Get Display Start The subfunctions either set the display start to a specific pixel location (Set Display Start) or return the current starting address (Get Display Start). When setting the display start address, it is possible that all pixel positions are not available. In this case, the functions will fail and the display start will not change. 13.2.8.
32087C Video BIOS Support Returns: Parameter AX 13.2.9 Description VBE return status Function 08h: VBE Set/Get RAMDAC Palette Format These subfunctions either change the number of bits per primary (Set RAMDAC Format) or return the current number of bits per primary (Get RAMDAC Format). Note that some hardware is only capable of 6 bits per gun, also note that for strict VGA compatibility, the standard modes (modes 00h through 13h) usually only operate with a RAMDAC width of 6 bits per gun.
32087C Video BIOS Support 13.2.10 Function 09h: VBE Set/Get RAMDAC Palette Data The subfunctions either load the RAMDAC registers (Set RAMDAC Data) or retrieve the values currently loaded in the RAMDAC registers (Get RAMDAC Data). Though the specification includes references to a “secondary palette”, this portion of Function 09h is actually reserved for future VBE expansion.
32087C Video BIOS Support 13.2.10.3 Subfunction 02h: Set Secondary RAMDAC Data Passed: Parameter Description AH 4Fh AL 09h BL 02h CX Number of palette registers DX First palette register ES:DI Pointer to palette values Returns: Parameter AX Description VBE return status 13.2.10.
32087C Video BIOS Support 13.2.11 Function 0Ah: Return VBE Protected Mode Information Description: Calling this function returns a real mode pointer (segment:offset) to the protected mode interface table. The table points to code that can be copied into an application’s memory space for execution from a 32-bit code segment. These functions execute a near return (“retn”) when returning to the calling application.
32087C Video BIOS Support 13.2.12 Function 10h: VBE Display Power Management Signaling (DPMS) Controls the power state of the attached display device or monitor. The VESA committee defined a method of signalling a monitor to shutdown or to go into standby mode. The sync signals are used in the following manner: H Sync Pulses None Pulses None V SyncResult PulsesMonitor is Active PulsesMonitor is in “Standby” mode NoneMonitor is in “Suspend” mode NoneMonitor is in “Shutdown” mode 13.2.12.
32087C Video BIOS Support 13.2.12.3 Subfunction 02h: Controller’s Currently Requested Power State Passed: Parameter Description AX 4F10h BL 02h ES:DI DS Null pointer Seg0 Returns: Parameter Description AX VBE return status BH Power state currently requested by controller: 0 = On 1 = Standby 2 = Suspend 4 = Off 8 = Reduced On 13.2.13 Function 11h: Flat Panel Interface Extensions (FP) The video BIOS does not implement this function. 13.2.
32087C Video BIOS Support 13.2.16 Function 14h: OEM Extensions Operates AMD specific extensions to the video BIOS. 13.2.16.1 Subfunction 00h: Refresh Rate Select This function is used to indicate the desired refresh rate for successive mode switches. It does not change the refresh rate of the current mode. Therefore, this function should be called before calling Function 02h to set a video mode. The number of possible refresh rates is limited by tables in the video BIOS.
32087C Video BIOS Support 13.2.16.3 Subfunction 03h: Set Fixed Timings Description: The system BIOS uses this function to load the resolution and timings. Passed: Parameter Description AX 4F14h BL 03h ES:DI Pointer to fixed timings Returns: None. 13.2.16.4 Subfunction 07h: Get Version Numbers Description: This subfunction returns the version numbers for the video BIOS and SMI handler.
32087C Video BIOS Support 13.2.17 Function 15h: VBE Display Data Channel Description: This optional function provides a mechanism to extract data from attached display devices on the VESA communication channel.
Miscellaneous Services 32087C 14 14.0Miscellaneous Services GeodeROM contains support for the miscellaneous software interrupts in Table 14-1. Table 14-1. Miscellaneous Software Interrupts Function Number/Name Page Number INT 09h - Keyboard 209 INT 10h - Video BIOS 209 INT 11h - Equipment List 210 INT 12h - Get Memory Size 210 14.1 Miscellaneous Services Functions Descriptions 14.1.1 INT 09h - Keyboard Description: Keyboard service required: – Reads Port 60h. – Calls INT 15, function 47.
32087C 14.1.3 Miscellaneous Services INT 11h - Equipment List Description: Returns a bit mask describing the devices installed in the system. Passed: None.
System Management Mode Software 32087C 15 15.0System Management Mode Software The System Management Mode (SMM) software for AMD Geode™ solutions has unique properties that allow for nontraditional features. The SMM software, along with specialized hardware, allows the System Management Interrupt (SMI) handler to simulate functionality normally associated with discrete devices (e.g., VGA, audio, UARTs, etc.).
32087C 15.1 System Management Mode Software Architecture The SMI handler is designed so no changes to the existing firmware are required. Individual binary components, called Virtual Support Modules (VSM), provide specific pieces of functionality. Each VSM is isolated from every other VSM in terms of functionality and code. VSA2 technology is architected using a client-server model. The VSM dispatcher is called the System Manager and acts as the server.
System Management Mode Software 15.2 32087C GeodeROM Requirements During POST, GeodeROM copies the VSA2 software image to a location below 640 KB, then executes a far call to the initialization code (Offset 20h). At the end of POST, GeodeROM notifies VSA2 software (via S/W SMI 5000h) so that any final initialization can take place. 15.3 System Manager When an SMI occurs, the processor micro-code saves minimal amount of processor state into an SMM header.
32087C 15.6 System Management Mode Software System Calls One of the design goals of GeodeROM VSA2 technology is to hide the implementation details. System calls and macros provide control mechanisms and access to sensitive system values and structures. Although VSMs could directly perform certain tasks, they should call the System Manager to perform these functions. This allows hardware bug fixes as well as Geode South Bridge details to be abstracted from the VSM.
System Management Mode Software 15.7.3 32087C Nested SMIs VSA2 makes full use of nested SMIs. SMI nesting is enabled at all times, with the following exceptions: • Within a critical section of a VSM • Within the System Manager • While handling virtual register accesses from VSMs The effect of SMI nesting is largely transparent to a VSM. Except for the small time-slice taken to record the event in the appropriate message queue, the interrupted VSM is unaffected.
32087C Sample VSM Message Handler unsigned char unsigned short unsigned long unsigned short unsigned char System Management Mode Software temp; Msg; Param[MAX_MSG_PARAM]; VirtualRegs[10]; Index; do { Msg = GET_NEXT_MSG(&Param); switch (Msg) { case MSG_INITIALIZE: // Register as handler of Power Management virtual registers SYS_REGISTER_EVENT(EVENT_VIRTUAL_REGISTER, VRC_PM, 0, 0); break; case MSG_EVENT: switch (Param[0]) { case EVENT_VIRTUAL_REGISTER: Index = (unsigned char) Param[1]; if (Param[2] = = 0)
32087C System Management Mode Software 15.8.3 VSM Header The VSM header encapsulates all data specific to a VSM. This design frees the System Manager from having to size its data structures based on a maximum number of VSMs. The only fields that need modifying in the header are the VSM_Type, VSM_Version, and EntryPoint. The VSM_Type field is only used for display purposes. The currently defined types, their values, and their use are listed in Table 15-1.
32087C System Management Mode Software 15.8.3.1 Sample VSM Header Format A sample VSM header format is as follows: typedef struct { unsigned long unsigned char unsigned char unsigned short unsigned short unsigned long unsigned short unsigned long Requirements unsigned short USHORT System } VSM_Header; Signature; VSM_Type; ForCPU; ForChipset; VSM_Version; VSM_Length; EntryPoint; DS_Limit; Flag; VSA_Version; AlignSystem SysStuff // 'VSM ' // Type of VSM (e.g.
32087C System Management Mode Software 15.9 Virtual Registers Virtual registers (VR) are I/O locations accessed with 16-bit index/data operations. The Geode hardware can be configured to trap I/O accesses. VSA2 interprets the data values and either treats the data as parameters (e.g., PM time-outs) or performs some function (e.g., change the TV encoder brightness). VRs provide a uniform method for the BIOS or third-party software to customize VSA2 software parameters and features (e.g., PM time-outs).
32087C System Management Mode Software 15.10 System Calls and Macros System calls preclude the need for a VSM to access a system structure directly. However, access to system data outside a VSM's data segment is occasionally necessary. The most common examples are fields within the SMI header and interrupted process registers. Macros are provided to access (read and write) these fields, and allow the System Manager to enforce access restrictions.
32087C System Management Mode Software 15.10.1 SYS_REGISTER_EVENT Unless a VSM is written specifically to perform an action at initialization with no runtime processing requirements, it must invoke SYS_REGISTER_EVENT to request notification of desired events. Otherwise, the only events the VSM receives are those broadcast by the System Manager or other VSMs. The SYS_REGISTER_EVENT macro is used to control a VSM's access to the specified event.
32087C System Management Mode Software The EVENT_IO_TRAP and EVENT_IO_TIMEOUT events are not completely general-purpose in the Geode GX1 processor and single chip (SC1100, SC1200, SC1201, SC2200, and SC3200) processors. The intention is to provide a common interface to the variety of I/O traps and timers supported by the hardware. If the I/O base does not match one of the traps or time-outs directly supported by the South Bridge, the System Manager attempts to use the user-defined trap hardware.
32087C System Management Mode Software 15.10.2 SYS_UNREGISTER_EVENT The SYS_UNREGISTER_EVENT macro cancels a prior event registration. The parameters passed are the same values passed when the event was registered. See Table 15-3 on page 221. • Parameter0: Event Code • Parameter1: Dependent on the event • Parameter2: Dependent on the event 15.10.3 SYS_GET_NEXT_MSG The SYS_GET_NEXT_MSG macro retrieves the next message from a VSM's message queue. The macro returns an unsigned short message code.
32087C 15.10.6 System Management Mode Software SYS_SW_INTERRUPT The SYS_SW_INTERRUPT system call performs a software interrupt. Some interrupts may not be supported. Typical interrupts are INT 13h and INT 15h. The interrupt vector to which control is transferred depends on when the system call is executed. The System Manager snapshots the interrupt vector once when VSA2 is installed (early POST), and again at the end of POST.
32087C System Management Mode Software 15.11 Messages The GET_NEXT_MSG macro retrieves messages from the VSM message queue. The GET_NEXT_MSG macro takes one parameter, the address of an array of unsigned longs. Messages may have zero to MAX_MSG_PARAM parameters associated with them, depending on the message. The GET_NEXT_MSG macro fills the array with the parameters, if any, associated with the retrieved message.
32087C 15.11.3 System Management Mode Software MSG_SAVE_STATE This message is sent to each VSM in preparation for Save-to-Disk or Save-to-RAM. All information required for restoring the device(s) controlled by the VSM must be saved to the VSM's data segment. This message is sent one time by the Saveto-Disk or Save-to-RAM VSM. • No Parameters 15.11.4 MSG_RESTORE_STATE This message is sent to each VSM during a Resume-from-Disk or Resume-from-RAM.
System Management Mode Software 15.11.6 32087C MSG_EVENT MSG_EVENT is the most common message. When a registered event occurs, this message is sent to the VSM with the highest priority. If a VSM handles the event, the VSM does not have to do anything explicitly to notify the System Manager.
32087C System Management Mode Software 15.12 Events The main routine of all VSMs is a message handling loop. When an event occurs, the VSM(s) registered for that event are sent a MSG_EVENT message with the event code in Parameter0. Other parameters may also be passed, depending on the event. A VSM is only sent a MSG_EVENT message for the events that it registered as a handler. Table 15-7.
System Management Mode Software 15.12.3 32087C EVENT_AUDIO An audio event has occurred. The audio VSM reads the audio SMI source registers to determine the exact type of audio event. The parameters are only valid for trapped I/O, not asynchronous audio events such as audio FIFO empty.
32087C 15.12.8 System Management Mode Software EVENT_MEMORY_TRAP An access to a registered memory location has occurred. • Parameter1 — Memory address (physical) • Parameter2 — 01h = BYTE access — 03h = WORD access — 0Fh = DWORD access — Bit 7 is set if access is a memory write • Parameter3 — Data (valid only if access is a write) 15.12.9 EVENT_MEMORY_TIMEOUT An access to a trapped memory location has not occurred for the interval specified when this event was registered.
System Management Mode Software 32087C 15.12.14 EVENT_TIMER A VSM may request to be notified every n milliseconds. This event is generated when the requested time interval has expired. The timer request remains active until the VSM cancels the request via SYS_UNREGISTER_EVENT. Since a VSM can request more than one timer to run concurrently, a handle may be specified when each timer is registered. When a timer elapses, the corresponding handle is passed as a parameter to distinguish among multiple timers.
32087C System Management Mode Software 15.13 Macros In addition to the system call macros discussed in Section 15.6 on page 214, there are other macros available to the VSM programmer. These are designed to achieve certain required functionality without the burden of understanding the implementation details. For example, if a VSM requires information from the SMM header, the method of reading the SMM header location is CPU dependent. Table 15-8.
32087C System Management Mode Software 15.13.1 ENTER_CRITICAL_SECTION, EXIT_CRITICAL_SECTION The critical section macros are used to mark the beginning and end of VSM code that should not be interrupted. Typically, this is brief sections of code that are very timing sensitive. For example, if a VSM creates a software-generated pulse of a precise duration, the VSM must not be interrupted. Otherwise, the pulse would be longer than desired.
32087C System Management Mode Software 15.13.4.2 GET_REGISTER The GET_REGISTER macro is used to retrieve a general-purpose register from the interrupted (non-SMM) task. • Parameter0 — Register name Note: This system call is only valid when servicing a synchronous event (EVENT_SOFTWARE_SMI, EVENT_IO_TRAP, EVENT_MEMORY_TRAP). Attempting to use it when servicing an asynchronous event is a programming error. Example of usage: Register_EDX = GET_REGISTER (R_EDX); // Get caller's EDX 15.13.4.
32087C System Management Mode Software 15.13.5 Shorthand Macros Since the AL, AX and EAX registers are the most commonly accessed registers, specific macros are defined to facilitate readability of the code. These macros and their equivalent definitions are shown in Table 15-9. Table 15-9.
32087C System Management Mode Software 15.13.6.5 WRITE_PCI_BYTE • Parameter0 — PCI configuration address • Parameter1 — Data to write Example of usage: WRITE_PCI_BYTE(0x8000933D, InterruptPin); 15.13.6.6 WRITE_PCI_WORD • Parameter0 — PCI configuration address • Parameter1 — Data to write Example of usage: WRITE_PCI_WORD(0x80009304, Command); WRITE_PCI_DWORD • Parameter0 — PCI configuration address • Parameter1 — Data to write Example of usage: WRITE_PCI_DWORD(0x80009314, BAR1); 15.13.6.
Virtual Hardware 32087C 16 16.0Virtual Hardware AMD Geode™ solutions and the GeodeROM SMM software make it possible to emulate hardware functionality. The firmware responds to SMIs generated by specialized hardware and provides virtual devices such as the XpressAUDIO™ subsystem, the XpressGRAPHICS™ subsystem, RTC/CMOS devices, and UARTs. 16.1 Note: Virtual Video Section 16.1 applies to SoftVGA and the Geode GX1 processor only. For other SMI handlers, see their graphics software specification.
32087C 16.2 Virtual Hardware Virtual RTC/CMOS The GeodeROM SMM software can simulate an RTC/CMOS device by registering for the following two types of events at initialization: a timer to be notified every second (1000 ms) and I/O access to 70h and 71h. During the operation, two other timers are used for the following events: periodic interrupt and update in progress. During POST, the date and time in the V-RTC is initialized to midnight, January 1, 1980.
Power Management 32087C 17 17.0Power Management There are multiple industry-standard power management (PM) methods to be supported, each sharing common PM concepts such as device timeouts, power states, and power state transition diagrams. Power management methods typically differ primarily in the API and in some of the details, such as the number of power states and the types of power state transitions supported. The GeodeROM power management is modularized relative to SMM in a carefully defined manner.
32087C 17.2 Power Management PM Initialization Initialization requirements of power management consist primarily of writing various virtual registers within the PM virtual register class (see Table 17-1 on page 240).
32087C Power Management Table 17-1. PM Virtual Registers (Continued) Register 1. Defined As Description 11h INACTIVITY_CONTROL Used internally by APM VSM. 12h MOUSE_CONTROL Not implemented: Reserved. 13h RESUME_ON_RING Used internally by APM VSM. 14h SCI_CONTROL Used internally by V-ACPI VSM. 15h SCI_ROUTING Used internally by V-ACPI VSM. 16h VECTOR_SEGMENT Used internally by V-ACPI VSM. 17h VECTOR_OFFSET Used internally by V-ACPI VSM.
32087C 242 Power Management AMD Geode™ GeodeROM Functional Specification
Configuring/Customizing 32087C 18 18.0Configuring/Customizing 18.1 Quick Start 1) Make sure you have ml.exe (masm), link.exe, and nmake in your path. 2) Change directory (cd) to examples\newproj (this is a user dir). 3) Type “nmake all”. 4) Answer the questions. 18.2 Build Process The build process starts in the user directory by running nmake. The first time nmake runs, the configurator asks a series of questions about the platform.
32087C 18.5 Configuring/Customizing Build Files Non-source files used by the build process: • xpress\makefile - The master makefile for the GeodeROM tree - build options (targets) are discussed in Section 18.6 “Build Options”. • xpress\xromcfg.pl (The Configurator) - Sets up the build options for GeodeROM. • user\makefile - The makefile in the user directory sets up the user path and calls the xpress\makefile to do the build. The common targets in this makefile are the same as for the xpress\makefile.
32087C Configuring/Customizing 18.9 CMOS Setup 18.9.1 Setup Menus To enter setup, press the F1 key while booting the system. 18.9.1.1 General Menu Navigation Table 18-1 describes the keys used to navigate within menus. Table 18-1. Setup Navigation Keys Key Function Up Arrow Highlights the item above the currently highlighted item. If on the top item, highlights the last item. Down Arrow or Space Highlights the item below the currently highlighted item.
32087C Configuring/Customizing 18.9.1.3 Motherboard I/O Device Configuration Menu Figure 18-2 is the motherboard I/O devices menu. Note that some entries may not display depending on the platform and processor chip configured. For instance, serial port C is displayed only for Geode single chip processors. The values can be changed by highlighting the entry and pressing Enter to cycle through the choices. When done, press the escape key to exit this menu.
32087C Configuring/Customizing 18.9.1.4 Memory Optimization Menu Standard Menu Figure 18-3 shows the standard Memory Optimization menu. Unimplemented Unimplemented entries are grayed entries grayed they out out,are indicating indicating areatnot are notthey active thisattime. active this time. Memory Memory Optimization Type Optimization Types: Auto •- Auto •- Aggressive Aggressive Conservative •-Conservative Manual •- Manual Active in Manual OnlyOnly active in Manual mode.mode.
32087C Configuring/Customizing 18.9.1.5 TV Output Menu Figure 18-5 "TV Output and Configuration Menu" is present only with setup compiled for Geode single chip processors with TV Out support. 18.9.1.6 LPC Card Devices Menu Figure 18-6 "Low Pin Count (LPC) Bus Setup Menu" is present only with setup compiled for Geode single chip processors. Designs using these processors may not include a SIO.
Configuring/Customizing 18.9.2 32087C Programming Reference 18.9.2.1 Sample SMENU.ASM file: INIT_MENU MENU m_menu,"Main Menu",3,1,24,80,TOP_MENU ITEM "A. Time " SPECIAL_RTC_TIME "Time" ITEM_HELP "Set the current time in the RTC" ITEM "B. Date " SPECIAL_RTC_DATE "Date" ITEM_HELP"Set the current date in the RTC" SKIP_LINE ITEM "C. Motherboard I/O Device Configuration" GOTO_MENU io_menu ITEM_HELP "Set addresses for motherboard devices" SKIP_LINE ITEM "L.
32087C Configuring/Customizing 18.9.2.2 Macro Reference INIT_MENU INIT_MENU must be the first entry. It initializes the internal variables needed for the menu system. MENU name,title,ul,uc,lr,lc,flags This entry defines a menu screen. Parameters Description name The name of the menu. title The title of the menu displayed on the top border line of the menu. ul The location of this menu’s top row on the screen. uc The location of this menu’s leftmost column on the screen.
Configuring/Customizing 32087C LABEL_ITEM user_label Labels the current item with the user label and makes the following information PUBLIC: • LABEL_ITEM_user_label - The label of the item entry definition for the current item. • ITEM_MENU_ORDINAL_user_label - The ordinal of the menu containing the item. • ITEM_ORDINAL_user_label - The ordinal of the item within the menu. ITEM_HELP help_text Defines the help text that appears on the bottom line of the menu screen when this item is highlighted.
32087C Configuring/Customizing The following entries (CHOICE, SAME_CHOICES and RANGE) are mutually exclusive: CHOICE prompt,value Defines one of several choices for this field. Each time the item is selected, the system cycles to the next choice. There may be multiple CHOICE entries for a FIELD_DEFINITION. Parameters Description prompt Displayed next to the item when the value matches the current selected value. value The value for this choice.
Configuring/Customizing 32087C COMMENT_ITEM iname,row,col Defines a non-selectable item on the menu. This may be used for headings within a menu. It is the same as defining an item with the “NO_SELECT” flag. Parameters Description name The text placed on the menu window at the given row and column. row (optional) The row in the menu window where the item is placed. If omitted, the item is placed on the line after the last defined item. If the item is first, line two of the menu screen is used.
32087C Configuring/Customizing User Functions The DO_FUNCTION functions are contained in the SETMAIN.C file, and may be modified by the user. The function is a ‘c’ function with a ‘c’ calling sequence. The prototype of the function is: int function_name(int menu, int item); • Where: — Menu is the ordinal number of the menu that contains the item. — Item is the ordinal number of the item within the menu. The function must return one of the following: • Zero – The function had an error.
Debugging 32087C 19 19.0Debugging 19.1 MTEST PINS: MTEST is a Geode processor feature that generates special debug information used by hardware engineers to trace program execution. MTEST disables cache and DIMM1. DO NOT enable this feature if you do not plan on using it. 19.2 GPCS# The GPCS (General Purpose Chip Select) can be set to activate on I/O reads and writes to a 16-bit I/O location with a width of 1 to 32 bytes.
32087C 256 Debugging AMD Geode™ GeodeROM Functional Specification
Build Utilities 32087C 20 20.0Build Utilities This chapter discusses the usage of custom and off-the-shelf build utilities, each of which is required for building and debugging GeodeROM. 20.1 Custom Build Utilities by AMD • X2ROM.EXE - Converts a .EXE file to a zero-based binary image. • FLASHROM.COM - Updates the contents of a memory-mapped Flash ROM device. • RLE.EXE - Compresses a file using a Run Length Encoding algorithm. • BMPFLIP.
32087C Build Utilities X2ROM.EXE – .EXE to .ROM file conversion utility version 1.0 Magic number: 5A4Dh Bytes on last page: 01E4h Pages in file: 0008h Relocations: 0000h Paragraphs in header: 0020h Extra paragraphs needed: 0000h Extra paragraphs wanted: FFFFh Initial stack location: 0000:0000h Word checksum: 0000h Entry point: 0000:0000h Relocation table address: 001Eh Memory Needed: 4 KB X2ROM.
32087C Build Utilities 20.1.2 FLASHROM.COM – Flash ROM Device Update Utility FLASHROM.COM is used to update the contents of a Flash ROM device with a new version of GeodeROM or equivalent boot loader. Example of usage: "FlashROM file_name" [Flash & clear CMOS] The following displays the command line options supported by versions 8.00 and newer of FLASHROM.COM: FlashROM: Version 8.11 Platform = unknown/unknown FlashROM: Version 8.
32087C 20.1.3 Build Utilities RLE.EXE – Run Length Encoded Compression Utility RLE.EXE is used to compress code/data modules intended for inclusion in an GeodeROM firmware component image. RLE: Version 1.
Build Utilities 20.1.4 32087C BMPFLIP.EXE – Windows .BMP File Conditioning Utility BMPFLIP.EXE is used during the code build process to flip the order of bytes that appear in the OEM splash screen bitmap file. The resulting bitmap file contains the original image in a format more easily displayed by the GeodeROM component power-on code. Example of usage: bmpflip [in.
32087C 20.2 Build Utilities Off-The-Shelf Build Utilities This section lists those widely available build utilities required for building the GeodeROM component. A brief description accompanies each utility program’s name. • PERL.EXE – “PERL” language interpreter for creating the platform-specific RULES.MAK script. • MASM 6.11c or greater. This is a commercial product that must be purchased separately. — Upgrade to 6.14: ftp://ftp.microsoft.com/softlib/mslfiles/ML614.EXE — ML.EXE 6.11c or greater — ML.
Appendix A: Revision History 32087C Appendix ARevision History This document is a report of the revision/creation process of the AMD Geode™ GeodeROM Functional Specification. Any revisions (i.e., additions, deletions, parameter corrections, etc.) are recorded in the table(s) below. Table A-1. Revision History Revision # (PDF Date) Revisions / Comments 1.0 (7/27/01) Release 1.0 1.1 (1/02/02) Minor changes. A (August 2004) B (June 2005) C (March 2006) Many engineering changes.
www.amd.com One AMD Place • P.O.