Do yourself a favor, and get a BiosSavior before you begin. We bought ours from http://www.paragonca.com. 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 S2881 board has a 4Mbit PLCC chip:

+

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 S2881 board has a 4Mbit PLCC chip. This is the list of BiosSavior vendors:

−

http://www.paragonca.com/hardwareacc-rd1biossavior.html

+

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

−

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 coreboot'd 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 S2881 comes with a 4Mbit BIOS chip, which does not suffice to put a Linux kernel in ROM. However, it's sufficient to have a fully functional coreboot with FILO payload, as described below.

+

+

It turns out that you can also use an 8Mbit BIOS chip on the S2881. For instance, flashrom supports flashing the SST 49LF080A on the S2881 without problems. Having a 8Mbit chip allows putting a Linux kernel into the BIOS, as described in [http://www.linuxbios.org/Tyan_S2892_Build_Tutorial the S2892 the OLPC way] build tutorial.

===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 or from a SATA drive, you will need to use [http://www.etherboot.org Etherboot]. If you want to boot from an IDE drive, you can use [http://linuxbios.org/index.php/FILO FILO]. The rest of this document assumes you want to boot from SATA.

+

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, SATA drive, USB stick or CDROM, you can use [[FILO]].

===Building the payload===

===Building the payload===

−

Since the S2881 comes with a SATA controller, we need to build Etherboot.

+

In order to boot from a SATA disk, we use FILO.

+

+

Once you've downloaded FILO, you will need to put a file 'Config' in its root tree. An example can be found in the distribution, called 'defconfig'.

+

+

You can configure FILO to load Grub. Here's my Config, which does that:

+

+

# Use grub instead of autoboot?

+

USE_GRUB = 1

+

# Grub menu.lst path

+

MENULST_FILE = "hda1:/grub/menu.lst"

+

# Driver for hard disk, CompactFlash, and CD-ROM on IDE bus

+

IDE_DISK = 1

+

# Add a short delay when polling status registers

+

# (required on some broken SATA controllers)

+

IDE_DISK_POLL_DELAY = 1

+

# Driver for USB Storage

+

USB_DISK = 1

+

# VGA text console

+

VGA_CONSOLE = 1

+

PC_KEYBOARD = 1

+

# Enable the serial console

+

SERIAL_CONSOLE = 1

+

# Serial console; real external serial port

+

SERIAL_IOBASE = 0x3f8

+

SERIAL_SPEED = 115200

+

# Filesystems

+

FSYS_EXT2FS = 1

+

FSYS_ISO9660 = 1

+

# Support for boot disk image in bootable CD-ROM (El Torito)

+

ELTORITO = 1

+

# PCI support

+

SUPPORT_PCI = 1

+

# Enable this to scan PCI busses above bus 0

+

# AMD64 based boards do need this.

+

PCI_BRUTE_SCAN = 1

+

# Loader for standard Linux kernel image, a.k.a. /vmlinuz

+

LINUX_LOADER = 1

+

+

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

−

1. Download the latest version from http://www.etherboot.org. At the time of writing, that is Etherboot 5.4.1.<br>

3. Version 5.4.1 adds PXE support. which is not compatible with the LinuxBIOS/FILO code included in Etherboot. You will need to disable it by removing this line from src/Config:

+

terminal --timeout=15 serial console

−

CFLAGS+= -DPXE_IMAGE -DPXE_EXPORT

−

4. Etherboot has an (optional) boot prompt that allows you the choice of a network or disk boot. We always want to book from disk, so make sure you set ASK_BOOT to -1, which disables the prompt:

+

Now execute 'make', which will generate a filo.elf file that will be your payload. You will need to refer to this file to build coreboot as explained below, because it gets included in the coreboot ROM image.

−

CFLAGS+= -DASK_BOOT=-1

+

===Building coreboot ===

−

5. However, currently (2006-04-23) Etherboot/FILO needs a bit of time to detect SATA drives (but only after a cold boot). It seems at least 3 extra seconds are required, so to be safe update the FILO boot prompt delay (where you can choose different boot images) to 5 seconds in src/filo/Config.lb:

+

Download coreboot ([[Download coreboot]]). You need subversion revision 2251 or higher. Note that revisions 2288 through 2295 are known bad, do not use those.

−

AUTOBOOT_DELAY = 5

+

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

−

Now; before we build Etherboot, let's think about the kernel we want to boot first.

+

src/mainboard/tyan/s2881/Options.lb

−

===The kernel you boot===

+

You'll need to enable the following two lines:

−

The mkelfImage program from

+

#VGA Console

+

default CONFIG_CONSOLE_VGA=1

+

default CONFIG_PCI_ROM_RUN=1

−

ftp://ftp.lnxi.com

+

Now - if you are going to be using a rom chip larger than 512K, you will need to also make a change in

−

can be used to generate a kernel to boot with LinuxBIOS. Note that this is not required, you can also boot a normal kernel.

+

src/mainboard/tyan/s2881/Config.lb

−

You can use mkelfImage to combine the kernel and initrd you want to boot into an elf image that filo can boot, for instance like this:

+

Assuming you are using a 1MB chip, modify the onboard vga device info from this

This means you will also need to update etherboot-5.4.1/src/filo/Config with the new autoboot file:

+

to this

−

−

AUTOBOOT_FILE = "hde1:/linuxbios.elf"

−

−

Then build etherboot

−

cd etherboot-5.4.1/src

+

chip drivers/pci/onboard

−

make bin/tg3--filo.elf

+

device pci 6.0 on end

+

register "rom_address" = "0xfff00000"

+

end

−

===Building LinuxBIOS===

+

This tells coreboot where to find the VGA rom. Depending on the size of the rom chip you use, it will be at a different address (which is calculated from the top of the rom chip, and we prepend the vga rom to the coreboot image!).

If want VGA support you will need to include the VGA bios in the LinuxBIOS image. See below for more info on how to do that. If you don't need VGA, you will need to modify tyan/s2881/Config.lb. Comment out the line:

+

+

If you don't need VGA, you will need to modify tyan/s2881/Config.lb. Comment out the line:

option ROM_SIZE = 475136

option ROM_SIZE = 475136

+

+

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

+

+

option ROM_SIZE = 487424

Make you are using GCC 3.4 (not GCC 4.0), or your image will be too large, and then:

Make you are using GCC 3.4 (not GCC 4.0), or your image will be too large, and then:

Line 75:

Line 127:

===VGA bios===

===VGA bios===

−

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

+

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

−

You can see where your vga bios starts and how much space it takes by issuing

+

The s2881 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:

−

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

+

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

+

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.

−

Then get a copy of your vga bios

+

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.

We know that our VGA BIOS is 36K long. Only 2 files fit the bill: amipci_00.20 and amipci_03.20. If you run 'strings' on both files, you'll see that the former is the VGA BIOS, and the latter is the Option ROM for the Broadcom network card.

+

+

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

+

+

<code>cat amipci_00.20 coreboot.rom > final_coreboot.rom</code>

===Burning the bios===

===Burning the bios===

−

Make sure your Biossavior is set to RD1 (NOT to ORG), so that you can always revert to the original 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/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 [http://wiki.linuxbios.org/index.php/Mailinglist mailing list] if you can't figure it out by yourself.

+

+

===Hardware monitoring===

+

+

The s2881 has 2 HWM chips, each driving a number of fans and temperature sensors. As of SVN revision 2674, the main HWM chip that drives most of the fans (ADT7463) is configured to be in automatic (hardware) fan control mode, based on the temperature sensors connected to it. These are the specific HWM settings:

+

+

* fans under automatic hardware control

+

* fans blow by default at 25% speed

+

* if any of the sensors goes above 55C (Tmin), the fans start blowing harder to compensate

+

* if any of the sensors reach 70C (THERM limit), the fans start blowing at full speed

+

+

These settings should lead to longer fan life, reduced power consumption, and better protection against accidental fan speed misconfiguration from software. And the machine is a lot less loud under light load.

+

+

The original Tyan BIOS had these settings:

+

+

* fans under manual (software) control

+

* fans blow by default at 100% speed

+

* automatic mode Tmin set to 90C

+

* automatic mode THERM limit set to 100C

−

===Booting LinuxBIOS===

+

The coreboot settings should be more ideal for real world deployment, and are a lot safer.

−

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

+

{{GPL}}

−

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!

+

[[Category:Tutorials]]

Latest revision as of 23:22, 18 January 2014

Contents

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 S2881 board has a 4Mbit PLCC chip. This is the list of BiosSavior vendors:

While coreboot replaces the functions of the proprietary bios, it does NOT replace the VGA bios. If you want VGA on your coreboot'd 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 S2881 comes with a 4Mbit BIOS chip, which does not suffice to put a Linux kernel in ROM. However, it's sufficient to have a fully functional coreboot with FILO payload, as described below.

It turns out that you can also use an 8Mbit BIOS chip on the S2881. For instance, flashrom supports flashing the SST 49LF080A on the S2881 without problems. Having a 8Mbit chip allows putting a Linux kernel into the BIOS, as described in the S2892 the OLPC way build tutorial.

Now execute 'make', which will generate a filo.elf file that will be your payload. You will need to refer to this file to build coreboot as explained below, because it gets included in the coreboot ROM image.

Building coreboot

Download coreboot (Download coreboot). You need subversion revision 2251 or higher. Note that revisions 2288 through 2295 are known bad, do not use those.

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

This tells coreboot where to find the VGA rom. Depending on the size of the rom chip you use, it will be at a different address (which is calculated from the top of the rom chip, and we prepend the vga rom to the coreboot image!).

If you don't need VGA, you will need to modify tyan/s2881/Config.lb. Comment out the line:

option ROM_SIZE = 475136

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

option ROM_SIZE = 487424

Make you are using GCC 3.4 (not GCC 4.0), or your image will be too large, and then:

cd tyan/s2881/s2881
make

VGA bios

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

The s2881 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:

While booted with your proprietary BIOS, you can see where your vga bios starts
and how much space it takes by issuing
cat /proc/iomem | grep "Video ROM"
Then get a copy of your vga bios.
dd if=/dev/mem of=vgabios.bin bs=1k count=32 skip=768
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.

We know that our VGA BIOS is 36K long. Only 2 files fit the bill: amipci_00.20 and amipci_03.20. If you run 'strings' on both files, you'll see that the former is the VGA BIOS, and the latter is the Option ROM for the Broadcom network card.

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

cat amipci_00.20 coreboot.rom > final_coreboot.rom

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.

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.

Hardware monitoring

The s2881 has 2 HWM chips, each driving a number of fans and temperature sensors. As of SVN revision 2674, the main HWM chip that drives most of the fans (ADT7463) is configured to be in automatic (hardware) fan control mode, based on the temperature sensors connected to it. These are the specific HWM settings:

* fans under automatic hardware control
* fans blow by default at 25% speed
* if any of the sensors goes above 55C (Tmin), the fans start blowing harder to compensate
* if any of the sensors reach 70C (THERM limit), the fans start blowing at full speed

These settings should lead to longer fan life, reduced power consumption, and better protection against accidental fan speed misconfiguration from software. And the machine is a lot less loud under light load.

The coreboot settings should be more ideal for real world deployment, and are a lot safer.

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.