Difference between revisions of "Developer Manual/Tools"

From coreboot
Jump to: navigation, search
(External EPROM/Flash programmer that can program the flash chip on your motherboard)
(Serial console software)
(5 intermediate revisions by 5 users not shown)
Line 5: Line 5:
 
* A mainboard you want to port coreboot to.
 
* A mainboard you want to port coreboot to.
 
* Datasheets
 
* Datasheets
* A Linux/UNIX machine for development purposes
+
* A development machine (ideally separate from your target system, though there are some mavericks who use the target for development)
** The coreboot build environment is not well-supported on Windows. It may be possible to do it under cygwin but nobody has tried.
+
** A Linux/UNIX machine is recommended
 +
** Windows as a development platform tends to work, but is more complicated to set up, less commonly used (at least outside corporate firewalls) and tends to be slower in operation. Setup instructions: [[Developer Manual/Tools/Cygwin]], [[Developer Manual/Tools/MinGW]]
 
 
 
It's also handy to have one/some/all of the following:
 
It's also handy to have one/some/all of the following:
+
 
 
=== Artecgroup programmable LPC dongle ===
 
=== Artecgroup programmable LPC dongle ===
  
Line 28: Line 29:
 
* use a RTL8139 NIC (PCI network card) with 32 pin socket and the appropriate ZIF socket adapter with flashrom. this is a low cost approach. Check, whether flashrom will recognize your flash part in this scenario.
 
* use a RTL8139 NIC (PCI network card) with 32 pin socket and the appropriate ZIF socket adapter with flashrom. this is a low cost approach. Check, whether flashrom will recognize your flash part in this scenario.
 
* [http://www.dediprog.com/SPI-flash-in-circuit-programming/SF100 Dediprog SF100]:High speed spi programmer, can be used under both windows and linux(with flashrom). See [[Dediprog SF100|SF100 Usage]] for detail description.
 
* [http://www.dediprog.com/SPI-flash-in-circuit-programming/SF100 Dediprog SF100]:High speed spi programmer, can be used under both windows and linux(with flashrom). See [[Dediprog SF100|SF100 Usage]] for detail description.
 +
* [http://dangerousprototypes.com/docs/Bus_Pirate Bus Pirate v3/v4]: SPI programmer, similar to but less expensive than the Dediprog SF100. http://flashrom.org/Bus_Pirate#Speedup
  
 
=== BIOS Savior ===
 
=== BIOS Savior ===
Line 49: Line 51:
  
 
[[Image:Top_hat_flash.JPG|thumb|right|Top Hat Flash, PCB side to flip over soldered-on PLCC.]]
 
[[Image:Top_hat_flash.JPG|thumb|right|Top Hat Flash, PCB side to flip over soldered-on PLCC.]]
 +
 +
<br clear="all" />
 +
 +
=== Dual flash ===
 +
 +
[[File:Dual_parallel_flash.jpg|200px|thumb|right|Dual flash "pie". One for keeping working firmware image. Flash chips are selectable by a tumbler switch]]
 +
You may DIY yours dual flash device. As an example look here:
 +
[[Developer Manual/Tools/Dual Flash]]
  
 
<br clear="all" />
 
<br clear="all" />
Line 67: Line 77:
 
Image:Pushpin roms 1.jpg|Push pins with cut off needles, attached to ROM chips with super glue.
 
Image:Pushpin roms 1.jpg|Push pins with cut off needles, attached to ROM chips with super glue.
 
Image:Pushpin roms 2.jpg|More push pins on ROM chips.
 
Image:Pushpin roms 2.jpg|More push pins on ROM chips.
 +
Image:Curtain.jpeg|Alternative: with something used to support curtains.
 
</gallery>
 
</gallery>
  
Line 146: Line 157:
 
An alternative to a serial console may be a USB debug device. They are not so common, yet. Their advantage is higher speed than a serial console. One might hook an FPGA to it for profiling purposes or some automated checks. Accessing a USB debug device from within BIOS is not different than other USB devices, and is part of the USB standard.
 
An alternative to a serial console may be a USB debug device. They are not so common, yet. Their advantage is higher speed than a serial console. One might hook an FPGA to it for profiling purposes or some automated checks. Accessing a USB debug device from within BIOS is not different than other USB devices, and is part of the USB standard.
  
See also [[EHCI Debug Port]].
+
See also [[EHCI Debug Port]] and [[DIY_EHCI_debug_dongle]].
  
 
== Serial console software ==
 
== Serial console software ==
 +
 +
=== picocom ===
 +
 +
Picocom is a small yet effective serial termial program.
  
 
=== minicom ===
 
=== minicom ===

Revision as of 05:42, 15 January 2014

Before starting to work on coreboot support for a new mainboard and/or chipset you'll want a few development tools (both hardware and software). Not all of them are strictly required, a lot depends on your specific task and needs.

Basic requirements

  • A mainboard you want to port coreboot to.
  • Datasheets
  • A development machine (ideally separate from your target system, though there are some mavericks who use the target for development)
    • A Linux/UNIX machine is recommended
    • Windows as a development platform tends to work, but is more complicated to set up, less commonly used (at least outside corporate firewalls) and tends to be slower in operation. Setup instructions: Developer Manual/Tools/Cygwin, Developer Manual/Tools/MinGW

It's also handy to have one/some/all of the following:

Artecgroup programmable LPC dongle

The Artecgroup programmable LPC dongle (Now called FlexyICE) is a ROM emulator and debugging tool. See [1] and [2].

PC Engines lpc1A

This board is most useful if you are working on machines from the ALIX family, but could also be useful if you can expose an LPC header on another board.

External EPROM/Flash programmer that can program the flash chip on your motherboard

External programmers are not always necessary. Use your mainboard as a programmer instead. Boot up with a known-good image, then unplug the (DIP32, PLCC32, or DIP8) ROM chip while powered on. Reflash that secondary piece and try a reboot. Many boards allow for more than one type of flash to be programmed, but clearly are less versatile than real programmers.

  • Willem Universal EPROM Programmer: DOS, Windows software, work has started on Linux drivers, quite many types of EEPROM asf. ~ €35
  • IDE adapter for PLCC32 & DIP32 sockets: Has Linux 2.4 & 2.6 drivers $/€ ~48 (kit €33) free manual with schematics & component list downloadable (component cost approx. €5)
  • GALEP-4: Has beta Linux drivers ~$300. See Galep IV for a description on how to get the more modern Windows software working in Linux with wine.
  • use a RTL8139 NIC (PCI network card) with 32 pin socket and the appropriate ZIF socket adapter with flashrom. this is a low cost approach. Check, whether flashrom will recognize your flash part in this scenario.
  • Dediprog SF100:High speed spi programmer, can be used under both windows and linux(with flashrom). See SF100 Usage for detail description.
  • Bus Pirate v3/v4: SPI programmer, similar to but less expensive than the Dediprog SF100. http://flashrom.org/Bus_Pirate#Speedup

BIOS Savior

An installed BIOS Savior.

The BIOS Savior is a tool that plugs into and replaces the original mainboard Flash device. The BIOS Savior has its own Flash device and a socket for the original mainboard Flash device (PLCC or DIP versions are available). It features a switch to allow the developer to choose between which Flash device is accessed by the mainboard during read and write cycles.

This device helps to minimize the amount of hot swapping required and reduces mechanical and electrical stress on the BIOS chips.

The BIOS Savior is available from:

Top Hat Flash

A similar function is achieved by the Top Hat Flash which comes at no extra cost with many Elitegroup, and some GIGABYTE and Albatron mainboards like ECS KN3 SLI2 Extreme.

As you can guess from the photo to the side, it is two plcc sockets soldered together. The upper one carries a spare BIOS chip as a fallback / failsafe secondary bootable BIOS. By means of some 'obscure' cicuitry, the additional, secondary chip is being booted from, if you manually press / stick the TOP HAT FLASH onto your primary BIOS chip on the mainboard. Sadly, this simple technique does not seem to work with other boards right away.

After bootup, it can manually be lifted off the original BIOS chip, so the original BIOS can be reflashed after a failure. The RST# pin is wired to OE# on the spare chip, otherwise it's wired 1:1. Top Hat Flash is equipped with a Winbond W39V040AP FWH. It may rely on particular circuitry on the mainboard to operate.

Top Hat Flash, PCB side to flip over soldered-on PLCC.


Dual flash

Dual flash "pie". One for keeping working firmware image. Flash chips are selectable by a tumbler switch

You may DIY yours dual flash device. As an example look here: Developer Manual/Tools/Dual Flash


Chip removal tools

If you're hot-swapping your BIOS chips (i.e., removing the chip while your computer is running, then inserting another one) you'll usually need some tools.

There are different tools for DIP and PLCC chips (see photos). You can find them in most electronics stores, usually. Both types cost roughly 5-10 Euros.

Another very nifty idea is clipping off the needle point of normal office push pins, and then attaching them to (PLCC) ROM chips with super glue. That makes it pretty easy to insert and remove the ROM chips without extra tools.

Since after bootup, flash mem is not accessed anymore, you can even hot plug (plug in and out while PC powered on) push pin flashes. This way you save an external EEPROM programmer and mimic the procedure of top hat flash. Make sure you do not short circuit anything, though.

POST card

A POST card will save your life: it's the only output device (beside beeper) you have during the boot process. The term POST means Power On Self Test and comes from the original IBM specifications for the BIOS. Port 80 is a pre-defined I/O port to which programs can output a byte. The POST card displays the byte in hex on its 2 digit display. We use a lot of POST codes in coreboot, so if you can tell us the POST code you see, we will have some idea of what happened.

If your coreboot machine is working properly, you will see it count up from 0xd0 to 0xd9 (while it is gunzipping the kernel) and then display 0x98 (Linux idle loop). There are POST cards with ISA bus, PCI bus, USB und parallel port connectors (the latter for laptops).

Often they carry status LEDs for ISA/PCI signals such as: IRDY, BIOS-access, FRAME, OSC, PCI-CLK, RESET, 12V, -12V, 5V, -5V, 3.3V. Some cards were known to not function because the mainboard switches off the CLK on their slot after non-standard registration on PCI.

PCI POST cards can be found in various places.

See also How can I write to port 0x80 from userspace.

Null-modem cable

A so-called null-modem cable is used for transmitting the output from a serial coreboot (or GRUB- or Linux-) console to another computer where a terminal program (such as minicom) can be used to display/save the messages.

Compact Flash IDE adaptor

Solid state disks (e.g. CompactFlash cards) save time during the repeated boot process compared with regular hard disks.

Oscilloscope

For hardware debugging purposes when it goes down the most atomic details. Consider logic analyzers as alternative.

In Circuit Emulator hardware debugger

Allows very time-saving burn/debug cycles with added tracing capabilities but somewhat costly.

coreboot SDK

In Circuit chip programmer

Should allow you to program your BIOS even if it is soldered to the motherboard.

EPROM emulators

These hardware devices pretend to be an EEPROM chip.

USB debug devices

PLX NET20DC USB Debug Device.

An alternative to a serial console may be a USB debug device. They are not so common, yet. Their advantage is higher speed than a serial console. One might hook an FPGA to it for profiling purposes or some automated checks. Accessing a USB debug device from within BIOS is not different than other USB devices, and is part of the USB standard.

See also EHCI Debug Port and DIY_EHCI_debug_dongle.

Serial console software

picocom

Picocom is a small yet effective serial termial program.

minicom

Minicom is not just a serial terminal. It was written long before the internet existed and electronic communication was only possible with a modem to a mailbox-computer. Minicom is written with the ncurses library and provides its magic via a text interface. Other than logging, it provides z-modem up- and download-capability.

CuteCom

This is an easy to use serial-terminal-program which is even able to write all communication into a log-file. It needs a computer with installed Qt-libs.

CuteCom.png