Changeset 620 in xtideuniversalbios


Ignore:
Timestamp:
Oct 5, 2021, 1:01:04 PM (3 years ago)
Author:
Krister Nordvall
Message:

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.
Location:
trunk/XTIDE_Universal_BIOS_Configurator_v2
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Variables.inc

    r614 r620  
    2222
    2323; Equates and defines
    24 BOOT_MENU_DEFAULT_TIMEOUT           EQU     (TICKS_PER_MINUTE / 2)
    25 MAX_ALLOWED_IDE_CONTROLLERS         EQU     4   ; Maximum number of IDE controllers
    26 MAX_LITE_MODE_CONTROLLERS           EQU     2
    27 EEPROM_POLLING_TIMEOUT_TICKS        EQU     3   ; 1 tick = 54.9 ms
    28 XTIDE_SIGNATURE_LENGTH              EQU     6   ; XTIDE Universal BIOS signature string length (must be even)
    29 NUMBER_OF_EEPROM_TYPES              EQU     5
    30 MAX_EEPROM_SIZE_IN_BYTES            EQU     65536
    31 
     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) 
    3233
    3334; Program global variables
     
    5758    .28256_32kiB        resb    2
    5859    .28512_64kiB        resb    2
     60    .SST_39SF           resb    2
    5961endstruc
    6062
     
    9698
    9799    .wProgressUpdateParam       resb    2
    98     .wTimeoutCounter            resb    2
     100    .wTimeoutCounter            resb    2   ; On SSI, this is timeout cal
    99101    .wLastOffsetWritten         resb    2
    100102    .bLastByteWritten           resb    1
     
    105107struc FLASH_RESULT
    106108    .success                    resb    2
     109    .DeviceNotDetected          resb    2
    107110    .PollingTimeoutError        resb    2
    108111    .DataVerifyError            resb    2
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Buffers.asm

    r614 r620  
    173173    ret
    174174
     175;--------------------------------------------------------------------
     176; Buffers_GetSelectedEepromSizeInWordsToAX
     177;   Parameters:
     178;       Nothing
     179;   Returns:
     180;       AX:     Selected EEPROM size in WORDs
     181;   Corrupts registers:
     182;       BX
     183;--------------------------------------------------------------------
     184ALIGN JUMP_ALIGN
     185Buffers_GetSelectedEepromSizeInWordsToAX:
     186    eMOVZX  bx, [cs:g_cfgVars+CFGVARS.bEepromType]
     187    mov     ax, [cs:bx+g_rgwEepromTypeToSizeInWords]
     188
     189    cmp     bl, EEPROM_TYPE.SST_39SF
     190    jnz     SHORT .HaveEepromSize
     191    cmp     ax, [cs:g_cfgVars+CFGVARS.wImageSizeInWords]
     192    jae     SHORT .HaveEepromSize       
     193    shl     ax, 1   ; Auto-double SST size when too small.
     194.HaveEepromSize:
     195    ret
    175196
    176197;--------------------------------------------------------------------
     
    181202;       Nothing
    182203;   Corrupts registers:
    183 ;       AX, CX, DI
     204;       AX, BX, CX, DI
    184205;--------------------------------------------------------------------
    185206ALIGN JUMP_ALIGN
     
    187208    push    es
    188209
    189     eMOVZX  di, [cs:g_cfgVars+CFGVARS.bEepromType]
    190     mov     cx, [cs:di+g_rgwEepromTypeToSizeInWords]
     210    call    Buffers_GetSelectedEepromSizeInWordsToAX
     211    mov     cx, ax
    191212    sub     cx, [cs:g_cfgVars+CFGVARS.wImageSizeInWords]    ; CX = WORDs to append
    192213    jbe     SHORT .NoNeedToAppendZeroes
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/EEPROM.asm

    r593 r620  
    2828    dw      (32<<10) / 2
    2929    dw      (64<<10) / 2
     30    dw      (32<<10) / 2    ; EEPROM_TYPE.SST_39SF
     31                            ; Actual size of flash will be larger than 32K,
     32                            ; however most (all?) XUB devices map a 32K window.
    3033
    3134g_rgwEepromPageToSizeInBytes:
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Flash.asm

    r596 r620  
    123123    dw      DoNotWriteAnySdpCommand                 ; EEPROM_TYPE.28256_32kiB
    124124    dw      DoNotWriteAnySdpCommand                 ; EEPROM_TYPE.28512_64kiB
     125    dw      DoNotWriteAnySdpCommand                 ; EEPROM_TYPE.SST_39SF
    125126.rgfnEnableSdpAndFlash:     ; SDP_COMMAND.enable
    126127    dw      WriteSdpEnableCommandFor2816            ; EEPROM_TYPE.2816_2kiB
     
    129130    dw      WriteSdpEnableCommandFor28256or28512    ; EEPROM_TYPE.28256_32kiB
    130131    dw      WriteSdpEnableCommandFor28256or28512    ; EEPROM_TYPE.28512_64kiB
     132    dw      DoNotWriteAnySdpCommand                 ; EEPROM_TYPE.SST_39SF
    131133.rgfnDisableSdpAndFlash:    ; SDP_COMMAND.disable
    132134    dw      WriteSdpDisableCommandFor2816           ; EEPROM_TYPE.2816_2kiB
     
    135137    dw      WriteSdpDisableCommandFor28256or28512   ; EEPROM_TYPE.28256_32kiB
    136138    dw      WriteSdpDisableCommandFor28256or28512   ; EEPROM_TYPE.28512_64kiB
     139    dw      DoNotWriteAnySdpCommand                 ; EEPROM_TYPE.SST_39SF
    137140
    138141
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Main.asm

    r614 r620  
    5656%include "EEPROM.asm"
    5757%include "Flash.asm"
     58%include "FlashSST.asm"
    5859%include "IdeAutodetect.asm"
    5960%include "MenuEvents.asm"
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/FlashMenu.asm

    r602 r620  
    5656    at  MENUITEM.szQuickInfo,       dw  g_szNfoFlashEepromType
    5757    at  MENUITEM.szHelp,            dw  g_szNfoFlashEepromType
    58     at  MENUITEM.bFlags,            db  FLG_MENUITEM_PROGRAMVAR | FLG_MENUITEM_BYTEVALUE | FLG_MENUITEM_VISIBLE
     58    at  MENUITEM.bFlags,            db  FLG_MENUITEM_MODIFY_MENU | FLG_MENUITEM_PROGRAMVAR | FLG_MENUITEM_BYTEVALUE | FLG_MENUITEM_VISIBLE
    5959    at  MENUITEM.bType,             db  TYPE_MENUITEM_MULTICHOICE
    6060    at  MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,        dw  CFGVARS.bEepromType
     
    7272    at  MENUITEM.szQuickInfo,       dw  g_szNfoFlashSDP
    7373    at  MENUITEM.szHelp,            dw  g_szHelpFlashSDP
    74     at  MENUITEM.bFlags,            db  FLG_MENUITEM_PROGRAMVAR | FLG_MENUITEM_BYTEVALUE | FLG_MENUITEM_VISIBLE
     74    at  MENUITEM.bFlags,            db  FLG_MENUITEM_PROGRAMVAR | FLG_MENUITEM_BYTEVALUE
    7575    at  MENUITEM.bType,             db  TYPE_MENUITEM_MULTICHOICE
    7676    at  MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,        dw  CFGVARS.bSdpCommand
     
    8888    at  MENUITEM.szQuickInfo,       dw  g_szNfoFlashPageSize
    8989    at  MENUITEM.szHelp,            dw  g_szHelpFlashPageSize
    90     at  MENUITEM.bFlags,            db  FLG_MENUITEM_PROGRAMVAR | FLG_MENUITEM_BYTEVALUE | FLG_MENUITEM_VISIBLE
     90    at  MENUITEM.bFlags,            db  FLG_MENUITEM_PROGRAMVAR | FLG_MENUITEM_BYTEVALUE
    9191    at  MENUITEM.bType,             db  TYPE_MENUITEM_MULTICHOICE
    9292    at  MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,        dw  CFGVARS.bEepromPage
     
    134134    dw  EEPROM_TYPE.28256_32kiB
    135135    dw  EEPROM_TYPE.28512_64kiB
     136    dw  EEPROM_TYPE.SST_39SF
     137
    136138g_rgszValueToStringLookupForEepromType:
    137139    dw  g_szValueFlash2816
     
    140142    dw  g_szValueFlash28256
    141143    dw  g_szValueFlash28512
     144    dw  g_szValueFlashSST39SF
    142145
    143146g_rgwChoiceToValueLookupForSdpCommand:
     
    201204.AlreadySet:
    202205    mov     si, g_MenupageForFlashMenu
    203     jmp     Menupage_ChangeToNewMenupageInDSSI
    204 
     206    ePUSH_T bx, Menupage_ChangeToNewMenupageInDSSI
     207    cmp     WORD [g_cfgVars+CFGVARS.bEepromType], EEPROM_TYPE.SST_39SF
     208    jz      SHORT .DisableMenuitemsUnusedBySstFlash
     209    ; Fall to .EnableMenuitemsUnusedBySstFlash
     210
     211;--------------------------------------------------------------------
     212; .EnableMenuitemsUnusedBySstFlash
     213;   Parameters:
     214;       SS:BP:  Menu handle
     215;   Returns:
     216;       Nothing
     217;   Corrupts registers:
     218;       AX, BX
     219;--------------------------------------------------------------------
     220ALIGN JUMP_ALIGN
     221.EnableMenuitemsUnusedBySstFlash:
     222    mov     bx, g_MenuitemFlashSdpCommand
     223    call    EnableMenuitemFromCSBX
     224    mov     bx, g_MenuitemFlashPageSize
     225    jmp     EnableMenuitemFromCSBX
     226
     227;--------------------------------------------------------------------
     228; .DisableMenuitemsUnusedBySstFlash
     229;   Parameters:
     230;       SS:BP:  Menu handle
     231;   Returns:
     232;       Nothing
     233;   Corrupts registers:
     234;       AX, BX
     235;--------------------------------------------------------------------
     236ALIGN JUMP_ALIGN
     237.DisableMenuitemsUnusedBySstFlash:
     238    mov     bx, g_MenuitemFlashSdpCommand
     239    call    DisableMenuitemFromCSBX
     240    mov     bx, g_MenuitemFlashPageSize
     241    jmp     DisableMenuitemFromCSBX
    205242
    206243;--------------------------------------------------------------------
     
    217254    call    .MakeSureThatImageFitsInEeprom
    218255    jc      SHORT .InvalidFlashingParameters
     256    cmp     WORD [cs:g_cfgVars+CFGVARS.bEepromType], EEPROM_TYPE.SST_39SF
     257    jnz     SHORT .SkipAlignmentCheck
     258    call    .MakeSureAddress32KAligned
     259    jc      SHORT .InvalidFlashingParameters
     260.SkipAlignmentCheck:
    219261    push    es
    220262    push    ds
     
    225267    call    .InitializeFlashvarsFromDSSI
    226268    mov     bx, si                          ; DS:BX now points to FLASHVARS
     269    cmp     WORD [cs:g_cfgVars+CFGVARS.bEepromType], EEPROM_TYPE.SST_39SF
     270    jz      SHORT .FlashWithoutProgressBar
    227271    add     si, BYTE FLASHVARS_size         ; DS:SI now points to PROGRESS_DIALOG_IO
    228272    call    Dialogs_DisplayProgressDialogForFlashingWithDialogIoInDSSIandFlashvarsInDSBX
     273.FlashComplete:
    229274    call    .DisplayFlashingResultsFromFlashvarsInDSBX
    230275
     
    235280    ret
    236281
     282.FlashWithoutProgressBar:                   ; Worst case. SST devices will
     283    call    FlashSst_WithFlashvarsInDSBX    ; either complete flashing
     284    jmp     SHORT .FlashComplete            ; or timeout within 2 seconds.
     285
    237286;--------------------------------------------------------------------
    238287; .MakeSureThatImageFitsInEeprom
     
    246295ALIGN JUMP_ALIGN
    247296.MakeSureThatImageFitsInEeprom:
    248     call    .GetSelectedEepromSizeInWordsToAX
     297    call    Buffers_GetSelectedEepromSizeInWordsToAX
    249298    cmp     ax, [cs:g_cfgVars+CFGVARS.wImageSizeInWords]
    250299    jae     SHORT .ImageFitsInSelectedEeprom
     
    254303ALIGN JUMP_ALIGN, ret
    255304.ImageFitsInSelectedEeprom:
     305.AlignmentIs32K:
    256306.DoNotGenerateChecksumByte:
     307    ret
     308
     309;--------------------------------------------------------------------
     310; .MakeSureAddress32KAligned
     311;   Parameters:
     312;       SS:BP:  Ptr to MENU
     313;   Returns:
     314;       CF:     Set if EEPROM segment is not 32K aligned
     315;   Corrupts registers:
     316;       AX, BX, DX
     317;--------------------------------------------------------------------
     318ALIGN JUMP_ALIGN
     319.MakeSureAddress32KAligned:
     320    mov     ax, [cs:g_cfgVars+CFGVARS.wEepromSegment]
     321    and     ax, 007FFh
     322    jz      SHORT .AlignmentIs32K
     323    mov     dx, g_szErrAddrNot32KAligned
     324    call    Dialogs_DisplayErrorFromCSDX
     325    stc
    257326    ret
    258327
     
    304373    mov     [si+FLASHVARS.bEepromSdpCommand], al
    305374
     375    mov     ax, SST_PAGE_SIZE
     376    cmp     WORD [g_cfgVars+CFGVARS.bEepromType], EEPROM_TYPE.SST_39SF
     377    jz      SHORT .UseSstPageSize
     378
    306379    eMOVZX  bx, [cs:g_cfgVars+CFGVARS.bEepromPage]
    307380    mov     ax, [cs:bx+g_rgwEepromPageToSizeInBytes]
     381.UseSstPageSize:
    308382    mov     [si+FLASHVARS.wEepromPageSize], ax
    309383
     
    323397ALIGN JUMP_ALIGN
    324398.GetNumberOfPagesToFlashToAX:
    325     call    .GetSelectedEepromSizeInWordsToAX
     399    call    Buffers_GetSelectedEepromSizeInWordsToAX
    326400    xor     dx, dx
    327401    eSHL_IM ax, 1       ; Size in bytes to...
     
    335409
    336410;--------------------------------------------------------------------
    337 ; .GetSelectedEepromSizeInWordsToAX
    338 ;   Parameters:
    339 ;       Nothing
    340 ;   Returns:
    341 ;       AX:     Selected EEPROM size in WORDs
    342 ;   Corrupts registers:
    343 ;       BX
    344 ;--------------------------------------------------------------------
    345 ALIGN JUMP_ALIGN
    346 .GetSelectedEepromSizeInWordsToAX:
    347     eMOVZX  bx, [cs:g_cfgVars+CFGVARS.bEepromType]
    348     mov     ax, [cs:bx+g_rgwEepromTypeToSizeInWords]
    349     ret
    350 
    351 
    352 ;--------------------------------------------------------------------
    353411; .DisplayFlashingResultsFromFlashvarsInDSBX
    354412;   Parameters:
     
    368426.rgfnFlashResultMessage:
    369427    dw      .DisplayFlashSuccessful
     428    dw      .DisplayDeviceDetectionError
    370429    dw      .DisplayPollingError
    371430    dw      .DisplayDataVerifyError
     
    373432
    374433;--------------------------------------------------------------------
     434; .DisplayDeviceDetectionError
    375435; .DisplayPollingError
    376436; .DisplayDataVerifyError
     
    383443;       AX, DX, DI, ES
    384444;--------------------------------------------------------------------
     445ALIGN JUMP_ALIGN
     446.DisplayDeviceDetectionError:
     447    mov     dx, g_szErrEepromDetection
     448    jmp     Dialogs_DisplayErrorFromCSDX
     449
    385450ALIGN JUMP_ALIGN
    386451.DisplayPollingError:
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Strings.asm

    r614 r620  
    5353
    5454; Flashing related strings
    55 g_szFlashTitle:         db  "Flashing EEPROM, please wait.",NULL
    56 g_szErrEepromTooSmall:  db  "Image is too large for selected EEPROM type!",NULL
    57 g_szErrEepromPolling:   db  "Timeout when polling EEPROM.",LF
    58                         db  "EEPROM was not flashed properly!",NULL
    59 g_szErrEepromVerify:    db  "EEPROM did not return the same byte that was written.",LF
    60                         db  "EEPROM was not flashed properly!",NULL
    61 g_szPCFlashSuccessful:  db  "EEPROM was written successfully.",LF
    62                         db  "Press any key to reboot.",NULL
    63 g_szForeignFlash:       db  "EEPROM was written successfully.",NULL
     55g_szFlashTitle:             db  "Flashing EEPROM, please wait.",NULL
     56g_szErrEepromTooSmall:      db  "Image is too large for selected EEPROM type!",NULL
     57g_szErrAddrNot32KAligned:   db  "The selected EEPROM type requires the address to be 32 "
     58                            db  "kiB aligned (C800, D000, D800, E000, etc.)",NULL
     59g_szErrEepromDetection:     db  "EEPROM of type not found.",LF
     60                            db  "EEPROM was not flashed properly!",NULL
     61g_szErrEepromPolling:       db  "Timeout when polling EEPROM.",LF
     62                            db  "EEPROM was not flashed properly!",NULL
     63g_szErrEepromVerify:        db  "EEPROM did not return the same byte that was written.",LF
     64                            db  "EEPROM was not flashed properly!",NULL
     65g_szPCFlashSuccessful:      db  "EEPROM was written successfully.",LF
     66                            db  "Press any key to reboot.",NULL
     67g_szForeignFlash:           db  "EEPROM was written successfully.",NULL
    6468
    6569
     
    556560                                db  "2864 mod (8 kiB)",LF
    557561                                db  "28256 (32 kiB)",LF
    558                                 db  "28512 (64 kiB)",NULL
     562                                db  "28512 (64 kiB)",LF
     563                                db  "SST39SFx flash",NULL
    559564g_szValueFlash2816:             db  "2816",NULL
    560565g_szValueFlash2864:             db  "2864",NULL
     
    562567g_szValueFlash28256:            db  "28256",NULL
    563568g_szValueFlash28512:            db  "28512",NULL
     569g_szValueFlashSST39SF:          db  "SST39SFx",NULL
    564570
    565571g_szMultichoiceSdpCommand:      db  "None",LF
Note: See TracChangeset for help on using the changeset viewer.