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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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:
Note: See TracChangeset for help on using the changeset viewer.