better Flash/DoC intergration

This commit is contained in:
Li-Ta Lo 2001-07-19 03:10:50 +00:00
commit dcd75bd928
6 changed files with 73 additions and 60 deletions

View file

@ -23,9 +23,11 @@
#include <rom/fill_inbuf.h>
#include <string.h>
#include <stdlib.h>
#if USE_ELF_BOOT
#include <boot/elf.h>
#endif
#include "do_inflate.h"
#ifdef USE_TFTP
@ -42,16 +44,14 @@ int linuxbiosmain(unsigned long base, unsigned long totalram)
unsigned long initrd_start, initrd_size;
#ifdef USE_TFTP
char buffer[256];
char *bufptr;
int buflen;
#endif
char buffer[256];
char *bufptr;
int buflen;
#endif /* USE_TFTP */
#if USE_ELF_BOOT
return elfboot(totalram);
#else
#else /* !ELF_BOOT */
printk("\n");
printk("Welcome to start32, the open sourced starter.\n");
printk("This space will eventually hold more diagnostic information.\n");
@ -66,7 +66,7 @@ int buflen;
cmd_line = CMD_LINE;
#else
cmd_line = "root=/dev/hda1 single";
#endif
#endif /* CMD_LINE */
#ifdef LOADER_SETUP
loader_setup(base,
@ -76,21 +76,21 @@ int buflen;
&cmd_line,
&zkernel_start,
&zkernel_mask);
#endif
#endif /* LOADER_SETUP */
post_code(0xf1);
#ifdef PYRO_TEST1
printk(KERN_NOTICE "LiLa loader, press a key to test netboot_init:");
buflen = sizeof(buffer);
ttys0_rx_line(buffer, &buflen);
printk(KERN_NOTICE "LiLa loader, press a key to test netboot_init:");
buflen = sizeof(buffer);
ttys0_rx_line(buffer, &buflen);
#endif
#ifdef USE_TFTP
netboot_init();
printk(KERN_NOTICE "\nnetboot_init test complete, all is well (I hope!)\n");
#endif
#endif /* USE_TFTP */
DBG("Gunzip setup\n");
gunzip_setup();
@ -110,10 +110,10 @@ ttys0_rx_line(buffer, &buflen);
buflen = 512; // I know, not it's purpose,
// but it isn't being used at this point.
bufptr = (char *) initrd_start = 0x0400000;
while(buflen == 512) {
while (buflen == 512) {
buflen = tftp_fetchone(bufptr);
#ifdef DEBUG_TFTP
printk("Got block, bufptr = %lu, size= %u\n",bufptr, buflen);
printk("Got block, bufptr = %lu, size= %u\n",bufptr, buflen);
#endif
bufptr += buflen;
}
@ -130,7 +130,7 @@ printk("Got block, bufptr = %lu, size= %u\n",bufptr, buflen);
printk("Booting with command line: %s\n",cmd_line);
#endif
#endif /* TFTP_INITRD */
/* parameter passing to linux. You have to get the pointer to the
* empty_zero_page, then fill it in.
@ -181,5 +181,5 @@ printk("Got block, bufptr = %lu, size= %u\n",bufptr, buflen);
:: "i" (0x100000));
return 0; /* It should not ever return */
#endif
#endif /* ELF_BOOT */
}

View file

@ -39,27 +39,30 @@ static char rcsid[] = "$Id$";
#ifdef PYRO_SERIAL
/* experimental serial read stuffs */
int iskey(void) {
if( inb(TTYS0_LSR) & 0x01)
int iskey(void)
{
if (inb(TTYS0_LSR) & 0x01)
return(1);
return(0);
}
char ttys0_rx_char(void) {
char ttys0_rx_char(void)
{
char result;
while(!(inb(TTYS0_LSR) & 0x01));
while (!(inb(TTYS0_LSR) & 0x01));
result = inb(TTYS0_RBR);
return(result);
}
void ttys0_rx_line(char *buffer, int *len) {
void ttys0_rx_line(char *buffer, int *len)
{
int pos=0;
char chargot=0;
while(chargot != '\r' && chargot != '\n' && pos< *len) {
while (chargot != '\r' && chargot != '\n' && pos< *len) {
chargot = ttys0_rx_char();
buffer[pos++] = chargot;
}
@ -68,6 +71,7 @@ void ttys0_rx_line(char *buffer, int *len) {
}
#endif
void ttys0_init(void)
{
/* disable interrupts */

View file

@ -32,7 +32,10 @@
#include "ipl.h"
.code16
#ifdef STD_FLASH
.org 0xfe00
#endif
#define SIZE_ALL
#define REALLY_COMPACT
@ -114,7 +117,7 @@ check_row_column:
jl no_sdram
#endif /* SAFTY_CHECK */
#if 1
#if 0
subb $0x0b, %ch # row = row - 11
shlb $0x02, %ch # row * 4
@ -211,6 +214,7 @@ sis630ipl_start:
movw %ax, %ss
movw $SPL_RAM_SEG, %ax
movw %ax, %es
#ifdef STD_FLASH
movw $0xf000, %ax
movw %ax, %ds
@ -223,8 +227,7 @@ sis630ipl_start:
movw $DOC_WIN_SEG, %ax
movw %ax, %ds
#else
#else /* !STD_FLASH */
movw $sis950_init_table, %si # unlock SiS 950 LPC
movw $0x05, %cx # select Clock Selection
movw $0x2e, %dx # and Flash ROM I/F
@ -292,7 +295,7 @@ doc_delay:
incw %bp # increse current page number
cmpw $128, %bp # moved 63 KB ??
jl read_next_page # no, read next page
#endif /*else STD_FLASH */
#endif /* STD_FLASH */
sis630ipl_end:
jmp spl_vector # jump to SPL vector
@ -327,7 +330,7 @@ write_common:
read_spd:
/* Input: AH = 05h, AL = byte number of SPD to be read.
Output: BL = The value of specified SPD byte. */
movb $0x05, %ah
movb $0x05, %ah # set SMB Command == byte address
CALL_BP(sis_set_smbus)
movw $0x0312, %ax # Start, R/W byte Data
@ -348,7 +351,7 @@ read_spd_fail:
sis_get_smbus:
/* Input: AH - register index.
Output: AL - register value. */
Output: BL - register value. */
addb %ah, %dl # read SMBus byte 0
inb %dx, %al
movb %al, %bl # return result in BL
@ -402,14 +405,17 @@ pci_init_table:
.word 0x5201 # Refresh Cycle Enable
.word 0x0000 /* Null, End of table */
# .org 0x1f0
#ifdef STD_FLASH
.org 0xfff0
reset_vector:
# .byte 0xea # jmp to fe00:0000, where IPL
# .word 0x0000, DOC_WIN_SEG # starts in DoC
.byte 0xea # jmp to f000:fe00, where IPL
.word 0xfe00, 0xf000 # starts in Standard Flash
#else /* !STD_FLASH i.e. DoC Mil */
.org 0x1f0
reset_vector:
.byte 0xea # jmp to fe00:0000, where IPL
.word 0xfe00, 0xf000 # starts in DoC
.word 0x0000, DOC_WIN_SEG # starts in DoC
#endif /* STD_FLASH */
spl_vector:
.byte 0xea # jmp to 8000:0000, where SPL

View file

@ -132,7 +132,6 @@ apc_fixup(void)
regval = inb(0x71);
outb(regval | 0x40, 0x71);
/* Enable ACPI S3,S5 */
outb(0x04, 0x70);
regval = inb(0x71);

View file

@ -32,6 +32,7 @@
#include "ipl.h"
.code16
#ifdef STD_FLASH
.org 0xfe00
#endif
@ -213,6 +214,7 @@ sis730ipl_start:
movw %ax, %ss
movw $SPL_RAM_SEG, %ax
movw %ax, %es
#ifdef STD_FLASH
movw $0xf000, %ax
movw %ax, %ds
@ -225,8 +227,7 @@ sis730ipl_start:
movw $DOC_WIN_SEG, %ax
movw %ax, %ds
#else
#else /* !STD_FLASH */
movw $sis950_init_table, %si # unlock SiS 950 LPC
movw $0x05, %cx # select Clock Selection
movw $0x2e, %dx # and Flash ROM I/F
@ -294,7 +295,7 @@ doc_delay:
incw %bp # increse current page number
cmpw $128, %bp # moved 63 KB ??
jl read_next_page # no, read next page
#endif /*else STD_FLASH */
#endif /* STD_FLASH */
sis730ipl_end:
jmp spl_vector # jump to SPL vector
@ -415,15 +416,14 @@ pci_init_table:
#ifdef STD_FLASH
.org 0xfff0
reset_vector:
.byte 0xea # jmp to fe00:0000, where IPL
.word 0xfe00, 0xf000 # starts in DoC
#else
.byte 0xea # jmp to f000:fe00, where IPL
.word 0xfe00, 0xf000 # starts in Standard Flash
#else /* !STD_FLASH i.e. DoC Mil */
.org 0x1f0
reset_vector:
.byte 0xea # jmp to fe00:0000, where IPL
.word 0x0000, DOC_WIN_SEG # starts in DoC
#endif
#endif /* STD_FLASH */
spl_vector:
.byte 0xea # jmp to 8000:0000, where SPL

View file

@ -78,32 +78,36 @@ enable_lpt(struct superio *s)
static void
finishup(struct superio *s)
{
enter_pnp(s);
enter_pnp(s);
// don't fool with IDE just yet ...
if (s->floppy)
enable_floppy(s);
if (s->com1.enable)
enable_com(s, PNP_COM1_DEVICE);
if (s->com2.enable)
enable_com(s, PNP_COM2_DEVICE);
// don't fool with IDE just yet ...
if (s->floppy)
enable_floppy(s);
if (s->lpt)
enable_lpt(s);
exit_pnp(s);
if (s->com1.enable)
enable_com(s, PNP_COM1_DEVICE);
if (s->com2.enable)
enable_com(s, PNP_COM2_DEVICE);
if (s->lpt)
enable_lpt(s);
exit_pnp(s);
}
struct superio_control superio_sis_950_control = {
(void *)0, (void *)0, finishup, 0x2e, "SiS 950"
pre_pci_init: (void *) 0,
init: (void *) 0,
finishup: finishup,
defaultport: 0x2e,
name: "SiS 950"
};
#if 0
void
final_superio_fixup(void)
{
superio_sis_950.finishup((struct superio *) 0);
superio_sis_950.finishup((struct superio *) 0);
}
#endif