| There are issues with disk detection on the CK804 chipset. This is [http://linuxbios.org/pipermail/linuxbios/2007-September/024937.html being investigated].

+

|- bgcolor="#eeeeee" valign="top"

+

| USB

+

| style="background:yellow" | ?

+

| &mdash;

+

|- bgcolor="#eeeeee" valign="top"

+

| On-board ethernet

+

| style="background:lime" | Works

+

| &mdash;

+

|- bgcolor="#eeeeee" valign="top"

+

| PCI add-on cards

+

| style="background:yellow" | ?

+

| &mdash;

+

|- bgcolor="#eeeeee" valign="top"

+

| PCI Express add-on cards

+

| style="background:yellow" | ?

+

| &mdash;

+

|- bgcolor="#eeeeee" valign="top"

+

| Floppy

+

| style="background:yellow" | ?

+

| &mdash;

+

|- bgcolor="#eeeeee" valign="top"

+

| Serial port (COM1)

+

| style="background:lime" | Works

+

| Serial console for coreboot and Linux is fully operational.

+

|- bgcolor="#eeeeee" valign="top"

+

| PS/2 keyboard

+

| style="background:lime" | Works

+

| &mdash;

+

|- bgcolor="#eeeeee" valign="top"

+

| PS/2 mouse

+

| style="background:yellow" | ?

+

| &mdash;

+

|- bgcolor="#eeeeee" valign="top"

+

| Mainboard sensors/fans

+

| style="background:yellow" | ?

+

| &mdash;

+

|- bgcolor="#eeeeee" valign="top"

+

| CPU frequency scaling / powersave modes

+

| style="background:yellow" | ?

+

| Probably won't work as long as there's no ACPI implementation for this board(?)

+

|- bgcolor="#eeeeee" valign="top"

+

| [[Flashrom]]

+

| style="background:lime" | Works

+

| &mdash;

+

|}

+

===Before you begin===

===Before you begin===

Line 6:

Line 79:

http://www.ioss.com.tw/web/English/WheretoBuy.html

http://www.ioss.com.tw/web/English/WheretoBuy.html

−

Unfortunately the largest BiosSavior of the PMC type is only 512Kbyte; the proprietary bios is 1024Kbyte large. You can build a LinuxBIOS image in 512Kbyte, so this should not be a problem; you may want to buy a couple of extra 1Mbyte PLCC chips to save a copy of the original BIOS, and put it somewhere safe.

+

Unfortunately the largest BiosSavior of the PMC type is only 512Kbyte; the proprietary BIOS is 1024Kbyte large. You can build a coreboot image in 512Kbyte, so this should not be a problem; you may want to buy a couple of extra 1Mbyte PLCC chips to save a copy of the original BIOS, and put it somewhere safe.

−

While LinuxBIOS replaces the functions of the proprietary bios, it does NOT replace the VGA bios. If you want VGA on your linuxBIOS'd machine (not strictly necessary for servers), you will need to extract the VGA bios and concatenate it with the LinuxBIOS image, before burning it to your ROM. See below for details.

+

While coreboot replaces the functions of the proprietary BIOS, it does ''not'' replace the VGA BIOS. If you want VGA on your corebooted machine (not strictly necessary for servers), you will need to extract the VGA BIOS and concatenate it with the coreboot image, before burning it to your ROM. See below for details.

This wiki page is maintained by Ward Vandewege (ward at gnu dot org).

This wiki page is maintained by Ward Vandewege (ward at gnu dot org).

Line 14:

Line 87:

===Hardware===

===Hardware===

−

The S2891 comes with a 8Mbit BIOS chip (SST 49LF080A). This is sufficient to have a fully functional LinuxBIOS with FILO payload, as described below.

+

The S2891 comes with a 8Mbit BIOS chip (SST 49LF080A). This is sufficient to have a fully functional coreboot with FILO or LAB payload, as described below.

===Payload===

===Payload===

−

LinuxBIOS requires a [http://linuxbios.org/index.php/Payloads Payload] to boot an operating system.

+

coreboot requires a [[Payloads|payload]] to boot an operating system.

If you want to boot from the network, you will need to use [http://www.etherboot.org Etherboot].

If you want to boot from the network, you will need to use [http://www.etherboot.org Etherboot].

−

If you want to boot from an IDE drive, USB stick or CDROM, you can use [http://linuxbios.org/index.php/FILO FILO].

+

If you want to boot from an IDE drive, USB stick or CDROM, you can use [[FILO]].

−

Booting from SATA is problematic; the CK804 chipset on this board does not support a legacy IDE mode, so FILO and Etherboot can not boot directly from SATA (see [http://linuxbios.org/pipermail/linuxbios/2006-May/014654.html]). Putting a tiny Linux kernel in the rom image solves this problem though.

+

Booting from SATA is a bit harder; the CK804 chipset on this board does not support a legacy IDE mode, so FILO and Etherboot [http://linuxbios.org/pipermail/linuxbios/2006-May/014654.html can not boot directly from SATA].

−

===Building the payload===

+

In order to boot from SATA, we need to use 'linux-as-a-bootloader' (LAB) as a payload. You will need a 1MB ROM chip (thankfully the S2891 comes with a 1MB ROM chip) for this payload. It consists of a (stripped down) kernel + busybox, which can then be used to kexec a kernel from disk. If your disks are playing up, you will still have a busybox environment on boot, which could be useful for debugging.

−

TODO: this is work-in-progress. Come back in a bit...

+

=== Building the payload ===

−

In order to boot from a SATA disk, we use ... a kernel in the rom image.

+

You can build a coreboot image with a kconfig-style configuration tool (buildrom) if you want to use FILO or LAB. This is by far the easiest way to build a ROM image.

+

===Buildrom===

−

In order to get serial output from Grub, you will also need to add something like this to your menu.list:

If you want VGA support, a few changes are required in the linuxbios source tree. Edit this file:

+

Configure to your liking. If you use the LAB payload, make sure to exclude the kexec binary and boot menu from the initramfs, otherwise your image will be too big. Please note that currently only the FILO and LAB payloads have been tested. The other payloads likely require some more work before they will be useable. Patches are welcome, of course.

−

src/mainboard/tyan/s2891/Options.lb

+

make

−

You'll need to enable the following two lines:

+

If all goes well, you should now have a ROM image file

−

#VGA Console

+

deploy/tyan-s2891.rom

−

default CONFIG_CONSOLE_VGA=1

+

−

default CONFIG_PCI_ROM_RUN=1

+

−

Whether you want VGA or not, build a tyan/s2891 tree.

+

This image will be exactly 988KB large, leaving 36KB for the VGA BIOS.

If you do need VGA, modify the ROM_SIZE line to the following, because our VGA bios is only 36KB, not 48K:

+

Note the root device &mdash; FILO sees the first SATA device as hd4.

−

option ROM_SIZE = 1024*1024-36*1024

+

In order to get serial output from GRUB, you will also need to add something like this to your menu.lst:

−

NOTE: if you are planning to put the image in the built-in BiosSavior chip (which is only 512Kbyte), use this ROM_SIZE:

+

# serial port 0

+

serial --unit=0 --speed=115200

+

terminal --timeout=15 serial console

−

option ROM_SIZE = 512*1024-36*1024

+

====LAB payload====

−

Build the image:

+

Skip this section if you use the FILO payload.

−

cd tyan/s2891/s2891

+

The LAB payload expects a file /lab.conf on /dev/sda1 with contents like this:

−

make

+

−

If you see compilation errors, make sure you have GCC's stack protector disabled. See the [[stack protector]] page to deal with that.

+

CMDLINE="root=/dev/sda1 ro console=tty0 console=ttyS0,115200"

+

KERNEL="/vmlinuz-2.6.22.1"

+

INITRD=""

+

VT="1"

−

===VGA bios===

+

This is the kernel that you will be running after boot. It will be kexec'ed by the kernel that is burned into your ROM chip.

−

Skip this section if you don't need VGA support in your LinuxBIOS.

+

You will also need a statically linked copy of kexec, which the LAB payload expects to reside at

−

The s2891 VGA bios is 36K long. The last 4KB are not available in RAM after boot (with the proprietary BIOS), however, so we can NOT use this method to extract the VGA BIOS:

+

/sbin/kexec

−

While booted with your proprietary BIOS, you can see where your vga bios starts

+

If you are on a Debian-based system, you can easily recompile your kexec package to be statically linked by following these instructions:

−

and how much space it takes by issuing

+

−

<code>cat /proc/iomem | grep "Video ROM"</code>

+

−

Then get a copy of your vga bios.

+

−

<code>dd if=/dev/mem of=vgabios.bin bs=1k count=32 skip=768</code>

+

−

Our vga bios is 32K. Verify that the image is correct - it should start with 55 AA,

+

−

and contain strings that indicate it's your VGA bios. You should be able to clearly

+

−

make out 'ATI RAGE' etc.

+

−

So this does not work - the last 4K is missing. Thankfully, Anton Borisov has some tools that can extract the VGA BIOS - and other option ROMs, in fact - from the BIOS images that Tyan offers on its website.

+

cd /usr/src

+

apt-get source kexec-tools

+

export LDFLAGS="-static"

−

You can download the tool for Phoenix here:

+

Now edit kexec-tools-1.101-kdump10/kexec-tools-1.101/kexec/Makefile, change line 53 to

−

http://www.kaos.ru/biosgfx/download/PhoenixDeco_0.33.src.tar.gz

+

$(CC) $(LDFLAGS) $(KCFLAGS) -o $@ $(KEXEC_OBJS) $(UTIL_LIB) $(LIBS)

−

Then download the latest proprietary BIOS for the s2891 from the TYAN website:

+

(you're adding the LDFLAGS variable)

−

http://www.tyan.com/support_download_bios.aspx?model=S.S2891

+

cd kexec-tools-1.101-kdump10

+

dpkg-buildpackage -rfakeroot -b

+

cd ..

+

dpkg -i kexec-tools_1.101-kdump10-2ubuntu2_i386.deb

−

Once you have the image, you can display its contents like this:

+

Adjust the package name as necessary for your distribution. You can tell if your copy of kexec is statically linked by running 'file' on it:

Note that you '''must''' build a 32-bit version of kexec, because buildrom puts a 32 bit kernel into the ROM image. A 32-bit kexec can kexec into a 64 bit kernel, so if your system is 64 bit this will work just fine.

−

./phnxdeco 2891202T.wph -xs

+

The LAB code currently expects lab.conf and kexec to live in / on /dev/sda1.

−

That will create a number of new files:

+

===VGA BIOS===

−

-rw-r--r-- 1 ward ward 14643 2007-06-20 15:16 ACPI0.rom

+

Skip this section if you don't need VGA support in your coreboot.

−

-rw-r--r-- 1 ward ward 116 2007-06-20 15:16 ACPI1.rom

+

−

-rw-r--r-- 1 ward ward 28672 2007-06-20 15:16 bb.rom

+

−

-rw-r--r-- 1 ward ward 33913 2007-06-20 15:16 BIOSCOD0.rom

+

−

-rw-r--r-- 1 ward ward 22987 2007-06-20 15:16 BIOSCOD1.rom

+

−

-rw-r--r-- 1 ward ward 44635 2007-06-20 15:16 BIOSCOD2.rom

+

−

-rw-r--r-- 1 ward ward 60875 2007-06-20 15:16 BIOSCOD3.rom

+

−

-rw-r--r-- 1 ward ward 64891 2007-06-20 15:16 BIOSCOD4.rom

+

−

-rw-r--r-- 1 ward ward 6123 2007-06-20 15:16 BIOSCOD5.rom

+

−

-rw-r--r-- 1 ward ward 4907 2007-06-20 15:16 BIOSCOD6.rom

+

−

-rw-r--r-- 1 ward ward 1099 2007-06-20 15:16 DECOMPC0.rom

+

−

-rw-r--r-- 1 ward ward 4128 2007-06-20 15:16 DISPLAY0.rom

+

−

-rw-r--r-- 1 ward ward 787512 2007-06-20 15:16 LOGO0.rom

+

−

-rw-r--r-- 1 ward ward 8576 2007-06-20 15:16 MISER0.rom

+

−

-rw-r--r-- 1 ward ward 49152 2007-06-20 15:16 OPROM0.rom

+

−

-rw-r--r-- 1 ward ward 36864 2007-06-20 15:16 OPROM1.rom

+

−

-rw-r--r-- 1 ward ward 131072 2007-06-20 15:16 OPROM2.rom

+

−

-rw-r--r-- 1 ward ward 77824 2007-06-20 15:16 OPROM3.rom

+

−

-rw-r--r-- 1 ward ward 77824 2007-06-20 15:16 OPROM4.rom

+

−

-rw-r--r-- 1 ward ward 65536 2007-06-20 15:16 OPROM5.rom

+

−

-rw-r--r-- 1 ward ward 28061 2007-06-20 15:16 ROMEXEC0.rom

+

−

-rw-r--r-- 1 ward ward 25675 2007-06-20 15:16 ROMEXEC1.rom

+

−

-rw-r--r-- 1 ward ward 1234 2007-06-20 15:16 rom.scr

+

−

-rw-r--r-- 1 ward ward 39110 2007-06-20 15:16 SETUP0.rom

+

−

-rw-r--r-- 1 ward ward 40396 2007-06-20 15:16 STRINGS0.rom

+

−

-rw-r--r-- 1 ward ward 4 2007-06-20 15:16 TCPA_*0.rom

+

−

-rw-r--r-- 1 ward ward 26784 2007-06-20 15:16 TCPA_H0.rom

+

−

-rw-r--r-- 1 ward ward 23136 2007-06-20 15:16 TCPA_Q0.rom

+

−

-rw-r--r-- 1 ward ward 53472 2007-06-20 15:16 TEMPLAT0.rom

+

−

-rw-r--r-- 1 ward ward 8208 2007-06-20 15:16 UPDATE0.rom

+

−

After a bit of fun with 'strings', we can deduce that the OPROM1.rom file contains our VGA bios.

+

Download the latest proprietary BIOS for the S2891 from the Tyan website:

−

So, now that we have the proper VGA bios image (36K long), we need to concatenate the VGA bios with the linuxbios image

+

http://www.tyan.com/support_download_bios.aspx?model=S.S2891

−

<code>cat OPROM1.rom linuxbios.rom > final_linuxbios.rom</code>

+

Follow the description on [[VGA support]]. But first you have to cut away the flash description of the BIOS image:

−

===Burning the bios===

+

dd if=2891V203.wph of=2891V203.rom bs=1m count=1

−

Make sure your Biossavior is set to the 'RD1' position (not to 'ORG'!), so that you can always revert to the original bios.

+

At the time of writing this chapter you need to apply the following patch to bios_extract in order to make it work with the Tyan S2891 image:

+

+

diff --git a/bios_extract.c b/bios_extract.c

+

index cd87ee8..c045307 100644

+

--- a/bios_extract.c

+

+++ b/bios_extract.c

+

@@ -90,8 +90,9 @@ static struct {

+

{"AMIEBBLK", "AMIBIOSC", AMI95Extract},

+

{"Award BootBlock", "= Award Decompression Bios =", AwardExtract},

+

{"Phoenix FirstBIOS", "BCPSEGMENT", PhoenixExtract},

+

+ {"Phoenix ServerBIOS", "BCPSEGMENT", PhoenixExtract},

+

{"PhoenixBIOS 4.0", "BCPSEGMENT", PhoenixExtract},

+

- {"Phoenix TrustedCore", "BCPSEGMENT", PhoenixTrustedExtract},

+

+ {"Phoenix TrustedCore", "BCPSEGMENT", PhoenixExtract},

+

{NULL, NULL, NULL},

+

};

+

+

+

The file you are looking for is oprom_1.rom (at least in version 2.03 of the vendor bios)

+

+

===Burning the BIOS===

+

+

Make sure your BiosSavior is set to the 'RD1' position (not to 'ORG'!), so that you can always revert to the original BIOS.

On the target machine:

On the target machine:

−

cd LinuxBIOSv2/util/flashrom

+

cd coreboot-v2/util/flashrom

−

./flashrom -v -w path/to/your/linuxbios.rom

+

./flashrom -v -w path/to/your/final_coreboot.rom

−

If you want VGA support, make sure you burn the final_linuxbios.rom image!

+

If you want VGA support, make sure you burn the final_coreboot.rom image!

−

===Booting LinuxBIOS===

+

===Booting coreboot===

−

You now need to 'halt' the machine. A soft reset won't work the first time you boot from the proprietary BIOS into LinuxBIOS.

+

You now need to 'halt' the machine. A soft reset won't work the first time you boot from the proprietary BIOS into coreboot.

−

Since we set up serial output in the LinuxBIOS configuration files above, you will want to hook up a serial console (or a copy of minicom or the like) to see what the box is doing while starting up. Keep your eyes on the screen after hitting the power button - LinuxBIOS will be up and running way before you expect it!

+

Since we set up serial output in the coreboot configuration files above, you will want to hook up a serial console (or a copy of minicom or the like) to see what the box is doing while starting up. Keep your eyes on the screen after hitting the power button - coreboot will be up and running way before you expect it!

−

If you have problems, don't despair. Power down the box, switch the biossavior to 'ORG' and boot in the proprietary BIOS. Just don't forget to switch the biossavior back to the 'RD1' position before flashing the BIOS!

+

If you have problems, don't despair. Power down the box, switch the BiosSavior to 'ORG' and boot in the proprietary BIOS. Just don't forget to switch the BiosSavior back to the 'RD1' position before flashing the BIOS!

−

See what went wrong, and subscribe and post to the friendly and helpful [http://wiki.linuxbios.org/index.php/Mailinglist mailing list] if you can't figure it out by yourself.

+

See what went wrong, and subscribe and post to the friendly and helpful [[Mailinglist|mailing list]] if you can't figure it out by yourself.

Before you begin

Do yourself a favor, and get a BiosSavior before you begin. There are different models, make sure you order the one you need. It depends on the size and type of the ROM chip on your board. Our S2891 board has an 8Mbit PLCC chip. This is the list of BiosSavior vendors:

Unfortunately the largest BiosSavior of the PMC type is only 512Kbyte; the proprietary BIOS is 1024Kbyte large. You can build a coreboot image in 512Kbyte, so this should not be a problem; you may want to buy a couple of extra 1Mbyte PLCC chips to save a copy of the original BIOS, and put it somewhere safe.

While coreboot replaces the functions of the proprietary BIOS, it does not replace the VGA BIOS. If you want VGA on your corebooted machine (not strictly necessary for servers), you will need to extract the VGA BIOS and concatenate it with the coreboot image, before burning it to your ROM. See below for details.

This wiki page is maintained by Ward Vandewege (ward at gnu dot org).

Hardware

The S2891 comes with a 8Mbit BIOS chip (SST 49LF080A). This is sufficient to have a fully functional coreboot with FILO or LAB payload, as described below.

Payload

If you want to boot from an IDE drive, USB stick or CDROM, you can use FILO.

Booting from SATA is a bit harder; the CK804 chipset on this board does not support a legacy IDE mode, so FILO and Etherboot can not boot directly from SATA.

In order to boot from SATA, we need to use 'linux-as-a-bootloader' (LAB) as a payload. You will need a 1MB ROM chip (thankfully the S2891 comes with a 1MB ROM chip) for this payload. It consists of a (stripped down) kernel + busybox, which can then be used to kexec a kernel from disk. If your disks are playing up, you will still have a busybox environment on boot, which could be useful for debugging.

Building the payload

You can build a coreboot image with a kconfig-style configuration tool (buildrom) if you want to use FILO or LAB. This is by far the easiest way to build a ROM image.

Buildrom

Configure to your liking. If you use the LAB payload, make sure to exclude the kexec binary and boot menu from the initramfs, otherwise your image will be too big. Please note that currently only the FILO and LAB payloads have been tested. The other payloads likely require some more work before they will be useable. Patches are welcome, of course.

make

If all goes well, you should now have a ROM image file

deploy/tyan-s2891.rom

This image will be exactly 988KB large, leaving 36KB for the VGA BIOS.

FILO payload

Skip this section if you use the LAB payload.

When using FILO in GRUB emulation mode, it's important to get a few details right in your GRUB boot stanza. This is what mine looks like:

The binary will also be considerably larger than its dynamically linked cousin.

Note that you must build a 32-bit version of kexec, because buildrom puts a 32 bit kernel into the ROM image. A 32-bit kexec can kexec into a 64 bit kernel, so if your system is 64 bit this will work just fine.

The LAB code currently expects lab.conf and kexec to live in / on /dev/sda1.

VGA BIOS

Skip this section if you don't need VGA support in your coreboot.

Download the latest proprietary BIOS for the S2891 from the Tyan website:

If you want VGA support, make sure you burn the final_coreboot.rom image!

Booting coreboot

You now need to 'halt' the machine. A soft reset won't work the first time you boot from the proprietary BIOS into coreboot.

Since we set up serial output in the coreboot configuration files above, you will want to hook up a serial console (or a copy of minicom or the like) to see what the box is doing while starting up. Keep your eyes on the screen after hitting the power button - coreboot will be up and running way before you expect it!

If you have problems, don't despair. Power down the box, switch the BiosSavior to 'ORG' and boot in the proprietary BIOS. Just don't forget to switch the BiosSavior back to the 'RD1' position before flashing the BIOS!

See what went wrong, and subscribe and post to the friendly and helpful mailing list if you can't figure it out by yourself.

This work is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version. This work is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.