source: xtideuniversalbios/trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Variables.inc@ 620

Last change on this file since 620 was 620, checked in by Krister Nordvall, 4 years ago

Changes:

  • A huge thank you to Jayeson Lee-Steere for adding SST39SF0x0 flash ROM programming support to the configurator (XTIDECFG.COM). This means that there is no longer a need to use a separate program for flashing the Lo-Tech boards and other devices using these flash ROMs.
File size: 3.8 KB
Line 
1; Project name : XTIDE Univeral BIOS Configurator v2
2; Description : Global variables for configuration program.
3
4;
5; XTIDE Universal BIOS and Associated Tools
6; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2013 by XTIDE Universal BIOS Team.
7;
8; This program is free software; you can redistribute it and/or modify
9; it under the terms of the GNU General Public License as published by
10; the Free Software Foundation; either version 2 of the License, or
11; (at your option) any later version.
12;
13; This program is distributed in the hope that it will be useful,
14; but WITHOUT ANY WARRANTY; without even the implied warranty of
15; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16; GNU General Public License for more details.
17; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
18;
19
20%ifndef VARIABLES_INC
21%define VARIABLES_INC
22
23; Equates and defines
24BOOT_MENU_DEFAULT_TIMEOUT EQU (TICKS_PER_MINUTE / 2)
25MAX_ALLOWED_IDE_CONTROLLERS EQU 4 ; Maximum number of IDE controllers
26MAX_LITE_MODE_CONTROLLERS EQU 2
27EEPROM_POLLING_TIMEOUT_TICKS EQU 3 ; 1 tick = 54.9 ms
28XTIDE_SIGNATURE_LENGTH EQU 6 ; XTIDE Universal BIOS signature string length (must be even)
29NUMBER_OF_EEPROM_TYPES EQU 5
30MAX_EEPROM_SIZE_IN_BYTES EQU 65536
31SST_PAGE_SIZE_SHIFT EQU 12 ; Minimum we can erase is a 4K sector.
32SST_PAGE_SIZE EQU (1 << SST_PAGE_SIZE_SHIFT)
33
34; Program global variables
35struc CFGVARS
36 .pMenupage resb 2 ; Offset to MENUPAGE to display
37 .wFlags resb 2 ; Program flags - Only the low byte is used currently and code depend on this
38 .wImageSizeInWords resb 2 ; Size in words for loaded ROM or FILE
39 .wEepromSegment resb 2 ; Segment where EEPROM is located
40 .bEepromType resb 1 ; EEPROM type
41 .bEepromPage resb 1 ; EEPROM page size (EEPROM_PAGE)
42 .bSdpCommand resb 1 ; Command for Software Data Protection
43 resb 1
44 .szOpenedFile resb FILENAME_BUFFER_SIZE
45endstruc
46
47; Bit defines for CFGVARS.wFlags (changes here might require changes elsewhere)
48FLG_CFGVARS_FILELOADED EQU (1<<0) ; BIOS is loaded from file
49FLG_CFGVARS_ROMLOADED EQU (1<<1) ; BIOS is loaded from EEPROM
50FLG_CFGVARS_UNSAVED EQU (1<<2) ; BIOS has unsaved changes
51FLG_CFGVARS_CHECKSUM EQU (1<<3) ; Generate checksum byte
52
53; EEPROM types
54struc EEPROM_TYPE
55 .2816_2kiB resb 2
56 .2864_8kiB resb 2
57 .2864_8kiB_MOD resb 2 ; Reversed A0 and A3 address lines
58 .28256_32kiB resb 2
59 .28512_64kiB resb 2
60 .SST_39SF resb 2
61endstruc
62
63; Software Data Protection commands
64struc SDP_COMMAND
65 .none resb 2 ; Do not use any SDP command
66 .enable resb 2 ; Flash with SDP enable command
67 .disable resb 2 ; Flash with SDP disable command
68endstruc
69
70; Page sizes
71struc EEPROM_PAGE
72 .1_byte resb 2
73 .2_bytes resb 2
74 .4_bytes resb 2
75 .8_bytes resb 2
76 .16_bytes resb 2
77 .32_bytes resb 2
78 .64_bytes resb 2
79endstruc
80
81; Default CFGVARS settings
82DEFAULT_CFGVARS_FLAGS EQU FLG_CFGVARS_CHECKSUM
83DEFAULT_EEPROM_SEGMENT EQU 0D000h
84DEFAULT_EEPROM_TYPE EQU EEPROM_TYPE.2864_8kiB
85DEFAULT_PAGE_SIZE EQU EEPROM_PAGE.1_byte
86DEFAULT_SDP_COMMAND EQU SDP_COMMAND.enable
87
88
89; Variables required for flashing
90struc FLASHVARS
91 .fpNextSourcePage resb 4
92 .fpNextComparisonPage resb 4
93 .fpNextDestinationPage resb 4
94 .wPagesToFlash resb 2 ; 0 = 65536
95 .wEepromPageSize resb 2 ; 1, 2, 4, 8, 16, 32 or 64
96 .bEepromSdpCommand resb 1
97 .bEepromType resb 1
98
99 .wProgressUpdateParam resb 2
100 .wTimeoutCounter resb 2 ; On SSI, this is timeout cal
101 .wLastOffsetWritten resb 2
102 .bLastByteWritten resb 1
103 .flashResult resb 1
104endstruc
105
106; Flashing results
107struc FLASH_RESULT
108 .success resb 2
109 .DeviceNotDetected resb 2
110 .PollingTimeoutError resb 2
111 .DataVerifyError resb 2
112endstruc
113
114
115%endif ; VARIABLES_INC
Note: See TracBrowser for help on using the repository browser.