!**************************************************************************
!*
!* Boot-ROM-Code to load an operating system across a TCP/IP network.
!*
!* Module: pci.inc
!* Purpose: Definitions for accessing PCI BIOS functions
!* Entries: None
!*
!**************************************************************************
!*
!* Copyright (C) 2002-2003 Gero Kuhlmann <gero@gkminix.han.de>
!*
!* This program is free software; you can redistribute it and/or modify
!* it under the terms of the GNU General Public License as published by
!* the Free Software Foundation; either version 2 of the License, or
!* any later version.
!*
!* This program is distributed in the hope that it will be useful,
!* but WITHOUT ANY WARRANTY; without even the implied warranty of
!* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
!* GNU General Public License for more details.
!*
!* You should have received a copy of the GNU General Public License
!* along with this program; if not, write to the Free Software
!* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
!*
!* $Id: pci.inc,v 1.2 2003/01/25 23:29:40 gkminix Exp $
!*
#ifndef _HW_PCI_INC
#define _HW_PCI_INC
!
!**************************************************************************
!
! PCI BIOS functions:
!
PCI_FUNC_INST_CHECK equ $B101 ! PCI BIOS installation check
PCI_FUNC_FIND_DEV equ $B102 ! find PCI device
PCI_FUNC_FIND_CLASS equ $B103 ! find PCI class code
PCI_FUNC_BUS_OP equ $B106 ! PCI bus-specific operation
PCI_FUNC_READ_BYTE equ $B108 ! read configuration byte
PCI_FUNC_READ_WORD equ $B109 ! read configuration word
PCI_FUNC_READ_DWORD equ $B10A ! read configuration dword
PCI_FUNC_WRITE_BYTE equ $B10B ! write configuration byte
PCI_FUNC_WRITE_WORD equ $B10C ! write configuration word
PCI_FUNC_WRITE_DWORD equ $B10D ! write configuration dword
PCI_FUNC_GET_IRQ equ $B10E ! get IRQ routing table
PCI_FUNC_SET_IRQ equ $B10F ! set IRQ routing information
!
!**************************************************************************
!
! PCI register offsets:
!
PCI_REG_VENDOR_ID equ $0000 ! vendor ID (word)
PCI_REG_DEVICE_ID equ $0002 ! device ID (word)
PCI_REG_COMMAND equ $0004 ! command flags (word)
PCI_REG_STATUS equ $0006 ! status register (word)
PCI_REG_REVISION equ $0008 ! revision ID (byte)
PCI_REG_CLASS_PROG equ $0009 ! prog. interface level (byte)
PCI_REG_CLASS_DEVICE equ $000A ! device class (word)
PCI_REG_CACHE_SIZE equ $000C ! cache line size (byte)
PCI_REG_LATENCY_TIMER equ $000D ! latency timer (byte)
PCI_REG_HEADER_TYPE equ $000E ! header type (byte)
PCI_REG_BIST equ $000F ! self test (byte)
PCI_REG_ADDR_0 equ $0010 ! base addresses (dword)
PCI_REG_ADDR_1 equ $0014
PCI_REG_ADDR_2 equ $0018
PCI_REG_ADDR_3 equ $001C
PCI_REG_ADDR_4 equ $0020
PCI_REG_ADDR_5 equ $0024
! Header type 0 (normal devices)
PCI_REG_CARDBUS_CIS equ $0028
PCI_REG_SUBSYS_VEND equ $002C ! subsystem vendor ID (word)
PCI_REG_SUBSYS_ID equ $002E ! subsystem device ID (word)
PCI_REG_ROM_ADDR equ $0030 ! onboard ROM address (dword)
PCI_REG_CAP_LIST equ $0034 ! start of capability list
PCI_REG_INT_LINE equ $003C ! interrupt line number (byte)
PCI_REG_INT_PIN equ $003D ! interrupt pin number (byte)
PCI_REG_MIN_GNT equ $003E ! minimum grant time (byte)
PCI_REG_MAX_LAT equ $003F ! maximum latency time (byte)
!
!**************************************************************************
!
! Command register bit fields
!
PCI_CMD_IO equ %0000000000000001 ! enable I/O space
PCI_CMD_MEMORY equ %0000000000000010 ! enable memory space
PCI_CMD_MASTER equ %0000000000000100 ! enable bus mastering
PCI_CMD_SPECIAL equ %0000000000001000 ! enable special cycles
PCI_CMD_INVALIDATE equ %0000000000010000 ! use memory invalidate
PCI_CMD_VGA_PALETTE equ %0000000000100000 ! enable palette snoop
PCI_CMD_PARITY equ %0000000001000000 ! enable parity checking
PCI_CMD_WAIT equ %0000000010000000 ! enable addr stepping
PCI_CMD_SERR equ %0000000100000000 ! enable SERR
PCI_CMD_FAST_BACK equ %0000001000000000 ! enable back-to-back
!
!**************************************************************************
!
! Status register bit fields
!
PCI_STS_CAP_LIST equ %0000000000010000 ! support capabil. list
PCI_STS_66MHZ equ %0000000000100000 ! support 66 MHz bus
PCI_STS_UDF equ %0000000001000000 ! support UDF (obsolete)
PCI_STS_FAST_BACK equ %0000000010000000 ! support back-to-back
PCI_STS_PARITY equ %0000000100000000 ! detected parity error
PCI_STS_DEVSEL_MASK equ %0000011000000000 ! DEVSEL timing bits
PCI_STS_SIG_TARGET equ %0000100000000000 ! set on target abort
PCI_STS_REC_TARGET equ %0001000000000000 ! ack of target abort
PCI_STS_SIG_MASTER equ %0010000000000000 ! set on master abort
PCI_STS_SIG_SYSTEM equ %0100000000000000 ! set on system error
PCI_STS_DET_PARITY equ %1000000000000000 ! parity detected
!
!**************************************************************************
!
! PCI network class codes
!
PCI_BASE_NETWORK equ $02 ! network base class
PCI_CLASS_ETHERNET equ $0200
PCI_CLASS_TOKEN_RING equ $0201
PCI_CLASS_FDDI equ $0202
PCI_CLASS_ATM equ $0203
PCI_CLASS_OTHER equ $0280
!
!**************************************************************************
!
#endif
syntax highlighted by Code2HTML, v. 0.9.1