
Jan Yin Chan Electronics Co.,LTD. 386SX Single Chip PC
M6117D : System on a chip
DM&P
Jan Yin Chan Electronics Co,. LTD. M6117D 386SX Single Chip PC Page 59
8F-1,No.22,Wuchyuan 2RD.,Hsin Chuang city Taipei Hsien, Taiwan, R.O.C. Tel: 886-(02) 2298-0770 Fax: (02) 2299-1883
Auto_DRAM_sizing :
call DRAM_Type_Detection ; Detect and set the EDO DRAM
; enable 8042 address line 20 here
.386p
mov eax, cr0 ; Set PE
or al, 01h ; Enter protected mode
mov cr0, eax
cli
lgdt cs: big_gdt_descriptor
jmp short enter_protected_mode
enter_protected_mode:
mov ax, 0008h
mov ds, ax
mov ax, 01010h ; Set mode 30 for DRAM sizing
call Read_From_Chip
and al, 00000111b
or al, 11101000b
xchg ah, al
call Write_To_Chip
xor dx, dx ; store DRAM mode
mov esi, 3000h ; A13, A12 enable - bank 3
sizing_bank_23:
mov edi, 800h ; A11
and dl, 0f0h
or dl, 5 ; 5 --- 4M
mov ds: word ptr[esi+edi], 0aa99h
mov ds: word ptr[esi], 099aah ; dummy write
cmp ds: word ptr[esi+edi], 0aa99h
jz sizing_bank_23_end ; 4M, go to test next bank
mov edi, 400h ; A10
and dl, 0f0h
or dl, 3 ; 3 --- 1M
mov ds: word ptr[esi+edi], 0bb88h
mov ds: word ptr[esi], 088bbh ; dummy write
cmp ds: word ptr[esi+edi], 0bb88h
jz sizing_bank_23_end ; 1M, go to test next bank
mov edi, 2h ; A1
and dl, 0f0h
or dl, 1 ; 1 --- 256K
mov ds: word ptr[esi+edi], 0cc77h
mov ds: word ptr[esi], 077cch ; dummy write
cmp ds: word ptr[esi+edi], 0cc77h
jz sizing_bank_23_end ; 256K, go to test next bank
and dl, 0f0h ; none in this bank
sizing_bank_23_end:
Comentários a estes Manuais