# # flash.i86 - constants for assembler module of FlashCard programmer # # Copyright (C) 1997-2003 Gero Kuhlmann # # 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: flash.i86,v 1.5 2003/03/09 00:43:08 gkminix Exp $ # #==================================================================== # # We have to use some sort of preprocessor commands (either CPP defines # or GASP .equ commands) here because with Intel syntax GAS will treat # values assigned with .set or "=" as labels, and therefore construct # memory references instead of immediate arguments. # # Only include this file, if we are using it within a GAS source file. # Otherwise, a C compiler will print error messages. # Note that this file gets preprocessed by GASP. We cannot use CPP # because it doesnt like the # comment character, even with the # -traditional option. In addition, while GNU-CPP uses -traditional, # Cray CPP uses -N, AT&T-CPP uses -D-C and others are using probably # some even more exotic command line options, so thats not the least # portable. # #==================================================================== # # Include some required files from the i386 runtime library # #include "ldrec.i86" #include "bootp.i86" # #==================================================================== # # Offsets into the bootrom image # ROMSIZEVAL .equ H'0002 # Offset to romsize ROMCOMPSIZE .equ H'0010 # Offset to size of compressed image ROMPCIHDR .equ H'0018 # Offset to PCI header offset ROMPNPHDR .equ H'001A # Offset to PnP header offset ROMFLAGS .equ H'0024 # Offset to rom boot flags PCIVENDORID .equ H'0004 # Offset into PCI header for vendor ID PCIDEVICEID .equ H'0006 # Offset into PCI header for device ID PCIROMLEN .equ H'0010 # Offset into PCI header for ROM size PNPLENGTH .equ H'0005 # offset into PnP header for length PNPCHECKSUM .equ H'0009 # Offset into PnP header for checksum PNPDEVID .equ H'000A # Offset into PnP header for device ID PNPFLAGS .equ H'0015 # Offset into PnP header for flag byte FLAG_DDIM .equ B'10000000 # Mask for DDIM flag in PnP flag byte FLAG_FLOADER .equ B'00100000 # Flash loader flag in rom flags # #==================================================================== # # Internal identification numbers for Flash EPROM chips # CHIP_AT29C512 .equ 10 CHIP_AT29C010 .equ 11 CHIP_AT49F512 .equ 12 CHIP_AT49F001N .equ 13 CHIP_AT49F001T .equ 14 CHIP_AT29LV512 .equ 15 CHIP_AT29LV010 .equ 16 CHIP_SST29EE010 .equ 20 CHIP_SST29LE010 .equ 21 CHIP_SST39SF010 .equ 22 CHIP_SST39VF010 .equ 23 CHIP_SST39VF512 .equ 24 CHIP_AM29LV010 .equ 30 CHIP_AM29F010 .equ 31 CHIP_AM29LV001B .equ 32 CHIP_AM29LV001T .equ 33 CHIP_STM29F512 .equ 40 CHIP_STM29F010 .equ 41 CHIP_STM29W512 .equ 42 CHIP_STM29W010 .equ 43 CHIP_I28F512 .equ 50 CHIP_I28F010 .equ 51 CHIP_I28F020 .equ 52 CHIP_AM28F512 .equ 60 CHIP_AM28F010 .equ 61 CHIP_CAT28F512 .equ 70 CHIP_CAT28F010 .equ 71 CHIP_CAT28F020 .equ 72 # #==================================================================== # # Minimum required sizes to cover the address range to identify a # certain Flash EPROM. This depends on the Flash EPROM chip family. # AMD_MINSIZE .equ 32768 INTEL_MINSIZE .equ 8096 # #==================================================================== # # Layout of flash EPROM chip definition structure # FSTRUCT_INTID .equ H'0000 # offset to internal chip ID FSTRUCT_NAME .equ H'0002 # offset to chip name pointer FSTRUCT_ROMSIZE .equ H'0004 # offset to size of chip in bytes FSTRUCT_INT .equ H'0008 # offset to internal data FSTRUCT_SIZE .equ H'0008 # size of structure (w/o internal) # #==================================================================== # # Layout of flash EPROM interface definition structure # # If you changed any of these values, remember to also change the # structure definition in makeflash.h as well! # ISTRUCT_ID .equ H'0000 # offset to interface name pointer ISTRUCT_DEVTYPE .equ H'0002 # offset to interface bus type ISTRUCT_DEVLIST .equ H'0004 # offset to list of device IDs ISTRUCT_DETECT .equ H'0006 # offset to detection routine ISTRUCT_READ .equ H'0008 # offset to byte read routine ISTRUCT_WRITE .equ H'000A # offset to byte write routine ISTRUCT_VPPON .equ H'000C # offset to VPP-on routine ISTRUCT_VPPOFF .equ H'000E # offset to VPP-off routine ISTRUCT_INIT .equ H'0010 # offset to initialization routine ISTRUCT_CLEAN .equ H'0012 # offset to cleanup routine ISTRUCT_ERASE .equ H'0014 # offset to erase routine ISTRUCT_PROG .equ H'0016 # offset to programming routine ISTRUCT_VERIFY .equ H'0018 # offset to verify routine ISTRUCT_LOADER .equ H'001A # offset to pointer to loader struct ISTRUCT_FLAGS .equ H'001C # offset to flag word ISTRUCT_SIZE .equ H'001E # size of structure # Definition of interface flags IFLAGS_NEEDMEM .equ H'0001 # flag if direct memory access needed # Definition of interface device types. These types specify the layout of # the supported device list pointed to by ISTRUCT_DEVLIST. If its PCI, then # ISTRUCT_DEVLIST points to a vendor ID word, followed by a zero terminated # list of device IDs. If its ISA, ISTRUCT_DEVLIST points to a list of un- # terminated PnP ID strings. If an interface doesnt have an assigned PnP ID # string, it has to be IDEVTYPE_NONE. IDEVTYPE_NONE .equ H'0000 # no interface device type specified IDEVTYPE_PCI .equ H'0001 # interface device type PCI IDEVTYPE_ISA .equ H'0002 # interface device type ISA # #==================================================================== # # Layout of flash EPROM loader definition structure # LSTRUCT_INIOFS .equ H'0000 # offset to loader start offset LSTRUCT_ENDOFS .equ H'0002 # offset to loader end offset LSTRUCT_WINSIZE .equ H'0004 # offset to ROM address window size LSTRUCT_SIZE .equ H'0008 # size of structure WINMAXSIZE .equ 65536 # maximum window size (max. 64KB) WINID_MAGIC .assignc "netboot..toobten" WINID_LEN .equ 16 # #==================================================================== # # Vendor information for the boot rom image. These values have to be # identical to those in makeflash.h. # VENDOR_MAGIC .assignc "GK-makerom" # vendor ID VENDOR_SIZE .equ 3 # size of vendor ID in dwords VENDOR_PROGRAM .equ LOADER_TAG + 0 # tag for programmer segment VENDOR_ROMIMAGE .equ LOADER_TAG + 1 # tag for boot rom image