vastly improved IPL and chipsizer. Looks like DoC is a go on this machine, but

we'll see.
This commit is contained in:
Ronald G. Minnich 2000-12-08 19:45:35 +00:00
commit 82a6bdc293
2 changed files with 94 additions and 18 deletions

View file

@ -45,10 +45,19 @@ floppy: all
# we need the vmlinux.bin.gz padded out and then cat the linuxbios.rom
# at then end. We always copy it to /tmp so that a waiting root shell
# can put it on the floppy (see ROOTDOIT)
romimage: linuxbios.rom vmlinux.bin.gz.block
romimage: linuxbios.rom vmlinux.bin.gz.block docipl
cat vmlinux.bin.gz.block linuxbios.rom > romimage
cp romimage /tmp
docipl: ipl.o
objcopy -O binary -R .note -R .comment -S ipl.o adocipl
dd if=adocipl of=docipl bs=1 skip=1040384
# I have noe idea why you can not use $(CPUFLAGS) to compile ipl.S
# a bug with -Di686 ??
ipl.o: $(TOP)/src/northbridge/acer/m1631/ipl.S
gcc -save-temps -c -I$(TOP)/src/include -I$(TOP)/src $<
linuxbios.rom: linuxbios.strip mkrom
./mkrom -s 64 -f -o linuxbios.rom linuxbios.strip

View file

@ -1,3 +1,4 @@
#include <asm.h>
#include <cpu/p5/macros.h>
#define DOC_WIN_SEG 0xfe00
#define DOC_STACK_SEG 0x0400
@ -16,7 +17,61 @@
* ror it 16 bits, and as we grow the CAS, we just inc cs, and that will
* set the right value.
*/
#define INIT_MCR $0xf6640000
#define INIT_MCR $0xf6641000
/*#include <cpu/p5/start32.inc>*/
.org 0xfe000
.code16
_start: jmp _realstart
gdt: //GDT entry 0 (null segment)
.byte 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
// GDT 1
.word 0xffff, 0x0000 /* flat code segment */
.byte 0x0, 0x9a, 0xcf, 0x0
.word 0xffff, 0x0000 /* flat data segment */
.byte 0x0, 0x92, 0xcf, 0x0
gdtptr:
.word 3*8-1
.long gdt /* we know the offset */
.long 0
_realstart:
cli
movw %cs, %ax
movw %ax, %es
.byte 0x66 /* prefix */
.byte 0x26
.byte 0x0f, 0x01, 0x16 /* lgdt [es:offset]*/
.word gdtptr - EXT(_start) /* offset in segment */
movl %cr0, %eax
andl $0x7FFAFFD1, %eax /* PG,AM,WP,NE,TS,EM,MP = 0 */
orl $0x60000001, %eax /* CD, NW, PE = 1 */
movl %eax, %cr0
/* invalidate the cache */
invd
data32 ljmp $0x8, $.Lprotected
.Lprotected:
.code32
movw $0x10, %bx
movw %bx, %es
movw %bx, %ds
#ifdef USE_BIG_REAL
andb $0xfe, %al
movl %eax, %cr0
ljmp $0xfe00, $.Lunprotected
Lunprotected:
code16
#endif
/* WARNING: The new CALLSP code trashes the stack! */
/* I will leave this here for now, but you should also set it later. */
xorl %edi, %edi
movb $0x6c, %al
CALLSP(pci_read_dword)
@ -26,17 +81,18 @@
CALLSP(pci_write_dword)
rorl $16, %ecx
/* test 8 bit CAS */
movb $0, (%edi)
movb $0, 0
movb $1, 0x800
cmpb $0,(%edi)
cmpb $0,0
jnz sizeram
inc %cl
movb $1, 0x1000
cmpb $0, (%edi)
/* change the value we store each time. It makes debugging easier */
movb $2, 0x1000
cmpb $0, 0
jnz sizeram
inc %cl
movb $1, 0x2000
cmpb $0, (%edi)
movb $3, 0x2000
cmpb $0, 0
jnz sizeram
inc %cl
@ -50,15 +106,24 @@ sizeram:
/* now size the dram */
/* you had best have at least 32M; that's as small as we go */
/* rorr 20 the ecx value, to get row size into lsb */
movb $0, (%edi)
movb $0, 0
ror $20, %ecx
movl $0x400000, %esi
1:
movb $1, (%esi)
1:
#ifdef USE_BIG_REAL
addr32 movb $4, %es:(%esi)
#else
movb $4, %es:(%esi)
#endif
cmpb $4, %es:(%esi)
jne 1f
inc %cl
jz 1b
rol $1, %esi
jmp 1b
/* size is now in esi */
/* %ecx has setting for register */
1:
ror $1, %esi
rol $20, %ecx
/* set 4 banks. */
orb $1, %cl
@ -69,11 +134,11 @@ sizeram:
* Just set 4-bank mode, and set non-zero numbers into a few places.
* if the byte at 0 changes, you have two banks. Trivial.
*/
movb $0, (%edi)
movb $1, 0x1000
movb $1, 0x2000
movb $1, 0x4000
cmpb $0, (%edi)
movb $0, 0
movb $5, 0x1000
movb $6, 0x2000
movb $7, 0x4000
cmpb $0, 0
jz 1f /* only one bank */
orl $80000, %ecx
1:
@ -109,7 +174,8 @@ pci_read_dword:
inl %dx, %eax
mov %eax, %ecx
RETSP
.org 0x01f0
.org 0xfe1f0
reset_vector:
.byte 0xea # jmp to fe00:0000, where IPL
.word 0x0000, DOC_WIN_SEG # starts in DoC
@ -117,4 +183,5 @@ reset_vector:
spl_vector:
.byte 0xea # jmp to 8000:0000, where SPL
.word 0x0000, SPL_RAM_SEG # (LinuxBIOS) starts in RAM
pad: .byte 0, 0, 0, 0, 0, 0