Board:tyan/s2891: Difference between revisions

From coreboot
Jump to navigation Jump to search
m (Phcoder moved page Tyan S2891 to Board:tyan/s2891)
 

Latest revision as of 23:22, 18 January 2014

Status

Device/functionality Status Comments
CPU Works
RAM Works
IDE ?
IDE using CF-to-IDE adapter ?
SATA WIP There are issues with disk detection on the CK804 chipset. This is being investigated.
USB ?
On-board ethernet Works
PCI add-on cards ?
PCI Express add-on cards ?
Floppy ?
Serial port (COM1) Works Serial console for coreboot and Linux is fully operational.
PS/2 keyboard Works
PS/2 mouse ?
Mainboard sensors/fans ?
CPU frequency scaling / powersave modes ? Probably won't work as long as there's no ACPI implementation for this board(?)
Flashrom Works

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:

 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 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

coreboot requires a payload to boot an operating system.

If you want to boot from the network, you will need to use Etherboot.

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

Check out buildrom:

 svn co svn://coreboot.org/buildrom

Now configure buildrom:

 cd buildrom/buildrom-devel
 make menuconfig

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:

 title   Ubuntu LB, kernel 2.6.21-rc3
 root    (hd4,0)
 kernel    /boot/vmlinuz-2.6.21-rc3 root=/dev/sda1 ro console=tty0 console=ttyS0,115200
 savedefault
 boot

Note the root device — FILO sees the first SATA device as hd4.

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

 # serial port 0
 serial --unit=0 --speed=115200
 terminal --timeout=15 serial console

LAB payload

Skip this section if you use the FILO payload.

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

 CMDLINE="root=/dev/sda1 ro console=tty0 console=ttyS0,115200"
 KERNEL="/vmlinuz-2.6.22.1"
 INITRD=""
 VT="1"

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.

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

 /sbin/kexec

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

 cd /usr/src
 apt-get source kexec-tools
 export LDFLAGS="-static"

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

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

(you're adding the LDFLAGS variable)

 cd kexec-tools-1.101-kdump10 
 dpkg-buildpackage -rfakeroot -b
 cd ..
 dpkg -i kexec-tools_1.101-kdump10-2ubuntu2_i386.deb

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:

 file /sbin/kexec 

If all is well, you will see something like this:

 /sbin/kexec: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.0, statically linked, for GNU/Linux 2.2.0, stripped

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:

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

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

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

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:

  cd coreboot-v2/util/flashrom
  ./flashrom -v -w path/to/your/final_coreboot.rom

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.

GNU head 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.