2 * Copyright 2004 Tyan Computer
6 #include <console/console.h>
8 #include <device/device.h>
9 #include <device/pci.h>
10 #include <device/pci_ids.h>
11 #include <device/pci_ops.h>
15 * How to use the onboard device driver for option rom execution:
17 * 1. You need to add the driver to your mainboard Config.lb:
19 * chip drivers/pci/onboard
20 * device pci x.0 on end
21 * register "rom_address" = "0xfff80000"
23 * 2. Reduce the size of your normal (or fallback) image, by adding the
24 * following lines to your target Config.lb, after romimage "normal"
25 * # 48K for SCSI FW or ATI ROM
26 * option ROM_SIZE = 512*1024-48*1024
27 * 3. Create your vgabios.bin, for example using awardeco and put it in the
28 * directory of your target Config.lb. You can also read an option rom from
29 * a running system, but this is unreliable, as some option roms are changed
31 * # dd if=/dev/mem of=atix.rom skip=1536 count=96
32 * 4. After you built coreboot.rom, attach the option rom to your coreboot
34 * # cat ../atix.rom ./normal/coreboot.rom ./fallback/coreboot.rom > coreboot.rom
36 * Alternatively you can use the following script "nsxv" to build your image
43 * LBROOT=/home/yhlu/xx/xx
48 * cd "$LBROOT/freebios2/targets"
49 * rm -rf "$MBVENDOR/$MBMODEL/$MBMODEL"
50 * ./buildtarget "$MBVENDOR/$MBMODEL" &> "$LBROOT/x_b.txt"
51 * cd "$MBVENDOR/$MBMODEL/$MBMODEL"
53 * eval make &> "$LBROOT/x_m.txt"
54 * if [ $? -eq 0 ]; then
57 * echo "FAILED! Log excerpt:"
58 * tail -n 15 "$LBROOT/x_m.txt"
61 * cat ../atix.rom ./normal/coreboot.rom ./fallback/coreboot.rom > "$LBROOT/rom/"$MBMODEL"_coreboot.rom"
62 * cp -f "$LBROOT/rom/"$MBMODEL"_coreboot.rom" /home/yhlu/
68 static void onboard_enable(device_t dev)
70 struct drivers_pci_onboard_config *conf;
71 conf = dev->chip_info;
72 dev->rom_address = conf->rom_address;
75 struct chip_operations drivers_pci_onboard_ops = {
76 CHIP_NAME("Onboard PCI")
77 .enable_dev = onboard_enable,