Wanna play coreboot but have no supported physical motherboard? Don’t worry! AMD SimNow can help you out!
The official website of coreboot has a tutorial for using AMD SimNow, but it’s kind of brief stuff, i’ll try to demo here step by step, in windows OS.

Goal

Run coreboot on AMD SimNow virtual platform in Windows OS environment.

Prepare Environment

I’m use windows OS for this test, so environment as below:

  • OS: Windows8.1 x64, SimNow not works for 32bit
  • AMD SimNow v4.6.2 for windows: ->download
  • Coreboot v4
  • Coreboot windows build environment: win-build-env-015.7z

please notice that the win-build-env included coreboot v4 source code, but it may not be latest one, you can update it by git pull, but i got some build error when use default code, so i git clone http://review.coreboot.org/p/coreboot and replace this win-build-env coreboot version.

Choose SimNow Platform Configuration

After Check AMD developer knowledge base, SimNow supports platforms with coreboot lists as below:

  • Cheetah_1p.bsd
  • Cheetah_1p_jh.bsd
  • Cheetah_2p.bsd
  • Family10_1p.bsd

i’ve tried cheetah_*.bsd, but it takes a long time to boot due to ECC memory supported. So i suggest to use Family10_1p.bsd, after open this bsd by File->Open BSD in SimNow, you can check devices in menu View->Show Devices

  • AMD-8132 PCI-X controller
  • AMD-8111 I/O hub
  • Winbond W83627HF SIO

Choose Coreboot Mainboard

Which coreboot mainboard support SimNow Family10_1p.bsd? let’s try coreboot\src\mainboard\amd\serengeti_cheetah_fam10
You can found in Kconfig that it supports below list, should works for our chosen Family10_1p board.

 select NORTHBRIDGE_AMD_AMDFAM10
 select SOUTHBRIDGE_AMD_AMD8111
 select SOUTHBRIDGE_AMD_AMD8132
 select SUPERIO_WINBOND_W83627HF

VGA Support

You may found that SimNow system no display without this step, due to lack of onboard VBIOS binary. if you tried some unsupported VBIOS, you may get below error. check coreboot VGA_Support website if there’s a way to get supported VBIOS.

CBFS: WARNING: 'pci1022,2067.rom' not found.  
CBFS: Could not find file 'pci1022,2067.rom'.  
Option ROM execution disabled for PCI: 01:04.0

Luckily, AMD SimNow provided a simulated PCI VGA called Emerald Graphic Deivce. Do remember to enable options in coreboot to run VGA option ROMs, coreboot default enable run VGA option roms, so you can leave it as default when setting .config, but if no display, you will need to check these options.

    Chipset  --->
     [*] Setup bridges on path to VGA adapter 
     [*] Run VGA option ROMs
     Option ROM execution type (Native mode)  --->

Build Coreboot ROM for SimNow

please refer to this website for the step-by-step instructions for building a coreboot BIOS in a windows machine.
my steps as below:

*1. run go.bat, enter Msys2 coreboot build environment

*2. setting coreboot options by

$ make oldconfig

my configuration as below, others use default settings:

  • select mainboard vendor AMD
*  
* Mainboard  
*  
Mainboard vendor  
 5. AMD (VENDOR_AMD) (NEW) 
  • choose mainboard ‘Serengeti Cheetah (Fam10)’
Mainboard model  
 10. Serengeti Cheetah (Fam10) (BOARD_AMD_SERENGETI_CHEETAH_FAM10) (NEW)
  • choose seabios as a payload, you can also try other payloads, such as FILO which is introduced by the tutorial, but i can not build FILO successful. If you already have a payload ELF, you can select 2 and give the ELF file path.
*  
* Payload  
*  
Add a payload
  2. An ELF executable payload (PAYLOAD_ELF) (NEW)
  4. SeaBIOS (PAYLOAD_SEABIOS) (NEW)
  5. FILO (PAYLOAD_FILO) (NEW)

the configuration will be written to .config file

*3. build out coreboot.rom by

$ make 

if build success, you can check rom information as below, and coreboot.rom will be in build folder

coreboot.rom: 1024 kB, bootblocksize 2544, romsize 1048576, offset 0x0
alignment: 64 bytes, architecture: x86

Name                           Offset     Type         Size
cmos_layout.bin                0x0        cmos_layout  1776
fallback/romstage              0x740      stage        75709
fallback/ramstage              0x12f40    stage        70619
fallback/payload               0x24380    payload      56085
config                         0x31f00    raw          4321
revision                       0x33040    raw          700
(empty)                        0x33340    null         836184
    HOSTCC     cbfstool/rmodtool.o
    HOSTCC     cbfstool/rmodule.o
    HOSTCC     cbfstool/rmodtool (link)

Running Coreboot on SimNow

*1. run simnow.exe, and open Family10h_1p.bsd by File->Open BSD
*2. copy build/coreboot.rom to simnow_dir/Images

$ cp build/coreboot.rom /c/SimNow/images/

*3. Open SimNow Device Window by View->Show Devices

Double click the Memory Device to change bios rom to coreboot, change base address to fff00000 and size to 32 for 1MB BIOS ROM. notice that if you don’t change base address, you will not able to change size.

(Optional)Double click the AMD 8111 I/O Hub to add CD-ROM boot image, a windows XP CD-ROM in my case.

*4. Execute following commmands on ‘simnow>’ promt to open com port debug, coreboot will throw out debug messages, and then you can get these messages by Putty.exe in windows.

1 simnow> serial.SetCommPort pipe

*5. Start the SimNow simulator by click the `Run Simulation’ button on main window

*6. Run Putty.exe in a new command prompt to capture debug messages, please notice that you must run simulation before this step, or putty will unable to open serial port. command as below, you can make a bat file for this command.

start putty -serial \\.\pipe\SimNow.Com1

*7. After a few seconds, run emerald graphic VBIOS and video will appear, notice that Diagnostic Ports will show debug numbers on 80 port.

*8. Boot to load Seabios payload, and try to boot CD/DVD.

*9. Opps! windows BSOD… need some ACPI debugging or disable ACPI support here.

Add EDK2 Duet Payload

Wanna support UEFI? Let’s add EDK2 payload for coreboot. Please refer to notabs.org EDK2 Duet payload for coreboot.
After download the duetpayload package, you can find built out UEFI payload in this folder: e350m1-duetpayload-035\test-results\windows-build\images\EFILDR16.
If you want to build this payload, please follow the steps descripted in this page of notabs.org.
You can NOT just add it as a ELF payload file when build coreboot, so:
1. Build coreboot with None payload
2. Run cbfstool to add EFILDR16 as a payload to coreboot.rom binary

build/cbfstool build/coreboot.rom add-flat-binary -f ../edk2/build/images/EFILDR16 -n fallback/payload -l 0x100000 -e 0x102000

Note:
this UEFI payload size is about 918KB i can’t even add it into a 1MB size coreboot rom, so i increase the coreboot rom size to 2MB, and change the rom size of AMD SimNow to verify this payload.

Others

How to change size of coreboot.rom?
the build out rom size is 1MB in this example, you can change to 512KB when setting .config.

ROM Chip Size
 4. 512 KB (COREBOOT_ROMSIZE_KB_512) (NEW)

How to re-config coreboot settings?
If you want to change some settings in .config file, just re-run make oldconfig will not work, you can modify settings in .config, then run make clean before make oldconfig. But if you delete the .config and .config.old files, you have to re-config all settings.

.config sample file
my .config content

Coreboot post log
my putty log