seabios.git
12 years agoSimplify PCI hotplug acpi macros.
Kevin O'Connor [Thu, 22 Sep 2011 01:04:05 +0000 (21:04 -0400)]
Simplify PCI hotplug acpi macros.

Change the macros to pass the slot number via hex, and then remove
passing of duplicate information.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoConsolidate PCI hotplug definitions together in DSL file.
Kevin O'Connor [Thu, 22 Sep 2011 00:14:42 +0000 (20:14 -0400)]
Consolidate PCI hotplug definitions together in DSL file.

Move the PCI hotplug definitions next to each other.  This introduces
a notify method (\_SB.PCI0.PCNF) to help consolidate the code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoDelineate ACSP DSL code into sections.
Kevin O'Connor [Wed, 21 Sep 2011 23:58:42 +0000 (19:58 -0400)]
Delineate ACSP DSL code into sections.

Add comments around major sections of the DSL file.  Also, add scope
declarations where needed so that each section only contains one
scope.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoPrep version for next release.
Kevin O'Connor [Wed, 5 Oct 2011 01:43:37 +0000 (21:43 -0400)]
Prep version for next release.

12 years agoUpdate version to 1.6.3
Kevin O'Connor [Wed, 5 Oct 2011 01:14:09 +0000 (21:14 -0400)]
Update version to 1.6.3

12 years agoUpdate README file.
Kevin O'Connor [Wed, 5 Oct 2011 01:12:28 +0000 (21:12 -0400)]
Update README file.

12 years agoFix alignment bug in pci_bios_init_root_regions().
Kevin O'Connor [Sat, 1 Oct 2011 16:35:32 +0000 (12:35 -0400)]
Fix alignment bug in pci_bios_init_root_regions().

If there are no memory allocations for a given type then the "max" bar
size is zero.  However, ALIGN_DOWN does not handle an alignment of
zero properly.  Catch and handle the zero case.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoReorder build objects to work around gcc bug with -combine.
Kevin O'Connor [Sat, 1 Oct 2011 14:43:48 +0000 (10:43 -0400)]
Reorder build objects to work around gcc bug with -combine.

Some versions of gcc have difficulties with externally visible
variables that are used before they are declared.  Now that pmm.c
contains only 32bit code and has a reference to CanPreempt, make sure
the declaration of CanPreempt (in stacks.c) is compiled first.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoProbe PCI existence
Jan Kiszka [Wed, 21 Sep 2011 06:16:21 +0000 (08:16 +0200)]
Probe PCI existence

This prevents lockups when trying to allocate PCI resources on an
ISA-only system like QEMU can emulate.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
12 years agoDefine handle_post as VISIBLE32FLAT as work around for QEmu memory layout.
Kevin O'Connor [Tue, 20 Sep 2011 23:42:14 +0000 (19:42 -0400)]
Define handle_post as VISIBLE32FLAT as work around for QEmu memory layout.

QEmu only copies the top 128K of the BIOS image to low memory
(0xe0000-0xfffff).  Images over 128K are only fully mapped in high
memory (0xfff00000).  However, the SeaBIOS shadow functions
(make_bios_writable_intel) will copy up to 256K to low memory.

SeaBIOS generally works with 256K roms because they are automatically
copied to low memory during the BIOS init.  However, this only works
if the shadow function code is itself part of the bios image that is
placed in low memory by QEmu.

Defining handle_post() as VISIBLE32FLAT will make the linker scripts
more likely to place the initial shadow code in the last 128K of the
image.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoMinor - move ACPI_HPET_ADDRESS definition to config.h.
Kevin O'Connor [Tue, 20 Sep 2011 23:40:28 +0000 (19:40 -0400)]
Minor - move ACPI_HPET_ADDRESS definition to config.h.

Move ACPI_HPET_ADDRESS to BUILD_HPET_ADDRESS in config.h so that it
is listed with similar hardcoded addresses.

Also, organize the BUILD_*_ADDRESS definitions in config.h.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoMinor formatting and comment updates to acpi.c.
Kevin O'Connor [Fri, 2 Sep 2011 22:11:58 +0000 (18:11 -0400)]
Minor formatting and comment updates to acpi.c.

12 years agoProbe HPET existence
Jan Kiszka [Mon, 29 Aug 2011 15:50:10 +0000 (17:50 +0200)]
Probe HPET existence

QEMU does not provide a HPET block if it was configured with -no-hpet,
other machines SeaBIOS runs on may lack a HPET as well. Perform basic
checks the ID register for a reasonable vendor ID and a clock period
within the valid range, do not build the HPET table if that fails.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
12 years agoUse coreboot smbios table if found.
Kevin O'Connor [Sun, 28 Aug 2011 16:42:15 +0000 (12:42 -0400)]
Use coreboot smbios table if found.

The coreboot init code now looks for an existing smbios table and will
use it.  A locally generated smbios table will only be created if no
coreboot table is found.

12 years agopci: re-add isa bridge setup
Gerd Hoffmann [Tue, 9 Aug 2011 15:22:42 +0000 (17:22 +0200)]
pci: re-add isa bridge setup

The switch to the two-pass pci initialization dropped the isa bridge
initialization by accident.  That broke interrupts on FreeBSD 4.4 and
maybe also other older guests which don't use ACPI for IRQ routing
setup.  Add the bits back in.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Tested-by: Bjørn Mork <bjorn@mork.no>
12 years agoahci: enable by default
Gerd Hoffmann [Thu, 4 Aug 2011 18:42:16 +0000 (20:42 +0200)]
ahci: enable by default

Lack of real hardware testing was the main reason to turn it off by
default.  The AHCI has been fixed to work on both qemu and real
hardware, so lets flip the switch now.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoahci: use malloc_tmp memory for probing ports
Gerd Hoffmann [Thu, 4 Aug 2011 17:36:31 +0000 (19:36 +0200)]
ahci: use malloc_tmp memory for probing ports

Also allocate the ahci port struct itself from tmp memory for probing,
then copy to fseg memory in case we detected some device.  This way we
don't waste fseg memory for unused ports.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoahci: move device registration
Gerd Hoffmann [Thu, 4 Aug 2011 17:36:30 +0000 (19:36 +0200)]
ahci: move device registration

Stick description and boot priority into the port struct, so it
holds everything needed to register the device, so we can do
the registration after ahci_port_init returned.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoahci: ignore atapi devices which are not cdroms
Gerd Hoffmann [Thu, 4 Aug 2011 17:36:29 +0000 (19:36 +0200)]
ahci: ignore atapi devices which are not cdroms

Also simplify the code a bit further down the road
as we know iscd must be true ;)

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoahci: probe each port in its own thread
Gerd Hoffmann [Thu, 4 Aug 2011 17:36:28 +0000 (19:36 +0200)]
ahci: probe each port in its own thread

Instead if creating a single thread which probes all ports one after
another kick one thread per port, so ports are probed in parallel.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoahci/cdrom: shared bounce buffer
Gerd Hoffmann [Thu, 4 Aug 2011 17:36:27 +0000 (19:36 +0200)]
ahci/cdrom: shared bounce buffer

This patch creates a common bounce buffer in block.c which
is shared by the cdrom and ahci drivers.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoAllow allocation of SMBIOS table in f-segment if it is small.
Kevin O'Connor [Thu, 4 Aug 2011 00:45:32 +0000 (20:45 -0400)]
Allow allocation of SMBIOS table in f-segment if it is small.

If the SMBIOS is small (less than 600 bytes) allow it to be allocated
in the f-segment.  This works around a bug in JunOS - it crashes on
SMBIOS tables located in high memory.

12 years agoAllow free space in f-segment to be used by malloc_fseg().
Kevin O'Connor [Thu, 4 Aug 2011 00:15:26 +0000 (20:15 -0400)]
Allow free space in f-segment to be used by malloc_fseg().

12 years agoWarn if not enough space in smp_mtrr array.
Kevin O'Connor [Fri, 29 Jul 2011 23:21:07 +0000 (19:21 -0400)]
Warn if not enough space in smp_mtrr array.

12 years agoseabios: increase smp_mtrr array size
Marcelo Tosatti [Fri, 29 Jul 2011 22:40:51 +0000 (19:40 -0300)]
seabios: increase smp_mtrr array size

Windows Server 2008 checked build complains about lack of consistency
between MTRR MSRs in SMP guests.

Problem is the smp_mtrr array is not large enough to hold all MSRs (31
entries with current qemu/kvm implementations).

Increase it to 32.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
12 years agoahci: bootprio support
Gerd Hoffmann [Thu, 14 Jul 2011 14:24:05 +0000 (16:24 +0200)]
ahci: bootprio support

Wind up bootprio support in the ahci driver so boot device ordering
works for ahci disks too.  No extra work needed on qemu side.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoahci: rework init workflow & fix timeout handling
Gerd Hoffmann [Thu, 14 Jul 2011 14:24:04 +0000 (16:24 +0200)]
ahci: rework init workflow & fix timeout handling

Rework init workflow to match suggestions in the ahci specs better,
especially remove the shortcut which tries to detect drives without
enabling FIS receiving.  This makes memory allocation a bit complicated
as we are using malloc_tmp() allocated memory now to probe the devices
so we can free it when no drive is present.  In case we detect a drive
we have to free and realloc the memory with malloc_low() so it is
available after POST when the boot loader wants read stuff via int13.

Also use TSC to calculate timeout instead of delays and loop counts.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoahci: don't expect ATA_CB_STAT_DRQ being clear
Gerd Hoffmann [Thu, 14 Jul 2011 14:24:03 +0000 (16:24 +0200)]
ahci: don't expect ATA_CB_STAT_DRQ being clear

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoahci: handle unaligned buffers.
Scott Duplichan [Thu, 14 Jul 2011 14:24:02 +0000 (16:24 +0200)]
ahci: handle unaligned buffers.

This change allows unaligned buffers to be used for reads or writes
to non-atapi devices. Currently only MS-DOS boot is known to need
unaligned buffer support.

Signed-off-by: Scott Duplichan <scott@notabs.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoahci: add error recovery code
Gerd Hoffmann [Thu, 14 Jul 2011 14:24:01 +0000 (16:24 +0200)]
ahci: add error recovery code

By Scott Duplichan.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoahci: use interrupt status register
Gerd Hoffmann [Thu, 14 Jul 2011 14:24:00 +0000 (16:24 +0200)]
ahci: use interrupt status register

Poll interrupt status register to figure when the device has updated the
status and possibly finished the request, continue polling until BSY is
clear as we might see multiple status updates per request.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoahci/sata: Fix FIS setup.
Gerd Hoffmann [Thu, 14 Jul 2011 14:23:59 +0000 (16:23 +0200)]
ahci/sata: Fix FIS setup.

FIS setup does't follow the SATA specs, fix it.

Credits go to Jonathan Kollasch and Scott Duplichan for finding those.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoxen: actually setup hypercalls.
Ian Campbell [Wed, 13 Jul 2011 10:46:40 +0000 (11:46 +0100)]
xen: actually setup hypercalls.

This was somehow dropped during the iterations of the original Xen patches.
It's actually harmless at the moment since there are no users of hypercalls but
patches are being written to support Xen PV block devices which need this.

It's not clear exactly how early this needs to be but I think it needs to be at
least before init_hw() (since that would detect disk devices).

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
12 years agoRemove 16bit wrappers from PMM code.
Kevin O'Connor [Sat, 16 Jul 2011 17:39:26 +0000 (13:39 -0400)]
Remove 16bit wrappers from PMM code.

Now that the PMM code is only run in 32bit mode, remove the
GET/SET_PMMVAR macros and other 16bit wrappers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoRun option rom visible PMM code in 32bit mode instead of 16bit mode.
Kevin O'Connor [Sat, 16 Jul 2011 17:13:12 +0000 (13:13 -0400)]
Run option rom visible PMM code in 32bit mode instead of 16bit mode.

Use call32() to jump into handle_pmm().  This reduces the amount of
16bit code needed.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agopci: set BUILD_PCIMEM_START to 0xe0000000
Gerd Hoffmann [Mon, 11 Jul 2011 07:20:32 +0000 (09:20 +0200)]
pci: set BUILD_PCIMEM_START to 0xe0000000

... and make it match with the declarations in acpi-dsdt.dsl.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agopci: cleanup config.h
Gerd Hoffmann [Mon, 11 Jul 2011 07:20:31 +0000 (09:20 +0200)]
pci: cleanup config.h

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agopci: remove old pci initilaization code
Gerd Hoffmann [Mon, 11 Jul 2011 07:20:30 +0000 (09:20 +0200)]
pci: remove old pci initilaization code

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agopci: activate two-pass pci initialization code
Gerd Hoffmann [Mon, 11 Jul 2011 07:20:29 +0000 (09:20 +0200)]
pci: activate two-pass pci initialization code

This patch actually enables the two-pass pci initialization and
deactivates the old pci initialization bits.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agopci: add two-pass pci initialization code
Gerd Hoffmann [Mon, 11 Jul 2011 07:20:28 +0000 (09:20 +0200)]
pci: add two-pass pci initialization code

This patch adds a second device scan to the pci initialization, which
counts the memory bars of the various sizes and types.  Then it
calculates the sizes and the packing of the prefetchable and
non-prefetchable pci memory windows and prints the results.

The patch doesn't actually map the devices to make debugging easier.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoUpdates to TODO list.
Kevin O'Connor [Wed, 13 Jul 2011 01:14:10 +0000 (21:14 -0400)]
Updates to TODO list.

12 years agoFix compile error - remove bmp.c from being compiled twice.
Kevin O'Connor [Wed, 13 Jul 2011 01:09:23 +0000 (21:09 -0400)]
Fix compile error - remove bmp.c from being compiled twice.

12 years agoRename the apm, pcibios, and elf entry points.
Kevin O'Connor [Mon, 11 Jul 2011 02:57:32 +0000 (22:57 -0400)]
Rename the apm, pcibios, and elf entry points.

Use a more consistent naming that matches entry_xxx to handle_xxx
where possible.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoSimplify POST entry code by moving reboot logic from post.c to resume.c.
Kevin O'Connor [Mon, 11 Jul 2011 02:35:07 +0000 (22:35 -0400)]
Simplify POST entry code by moving reboot logic from post.c to resume.c.

Detect a resume/reboot by inspecting HaveRunPost instead of inspecting
the cmos reset code.  Inspecting a global variable is both simpler and
safer.

Move the reboot logic from post.c to resume.c - this makes the code in
post.c simpler as it is now only called once on machine startup.  This
also makes it easier to ensure all POST initialization code resides in
the relocatable "init" sections.

Also, rename _start() to handle_post() so that it is more in keeping
with the entry_xxx() and handle_xxx() function naming.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoMinor fix - check for malloc failure in USB cntl allocation.
Kevin O'Connor [Sun, 10 Jul 2011 19:48:00 +0000 (15:48 -0400)]
Minor fix - check for malloc failure in USB cntl allocation.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoMinor fix - make sure not to call ohci/uhci_init from irq handler.
Kevin O'Connor [Sun, 10 Jul 2011 19:41:55 +0000 (15:41 -0400)]
Minor fix - make sure not to call ohci/uhci_init from irq handler.

When CONFIG_THREAD_OPTIONROMS is enabled, accessing the PCI config
space from a thread could potentially race with an option rom.  Make
sure the ohci/uhci_init() functions (which access PCI config space)
are never run while an optionrom could also be running.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoFix serial port flushing code.
Kevin O'Connor [Sat, 9 Jul 2011 22:42:34 +0000 (18:42 -0400)]
Fix serial port flushing code.

debug_serial() was doing a full flush while debug_serial_flush() was
only doing a partial flush.  Fix that.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoRemove now unneeded find_pci().
Kevin O'Connor [Sat, 9 Jul 2011 18:49:13 +0000 (14:49 -0400)]
Remove now unneeded find_pci().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoPush use of 'struct pci_device' to bootprio_find_pci_rom().
Kevin O'Connor [Sat, 9 Jul 2011 18:47:47 +0000 (14:47 -0400)]
Push use of 'struct pci_device' to bootprio_find_pci_rom().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoPush use of 'struct pci_device' to bootprio_find_ata_device().
Kevin O'Connor [Sat, 9 Jul 2011 18:42:11 +0000 (14:42 -0400)]
Push use of 'struct pci_device' to bootprio_find_ata_device().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoPush use of 'struct pci_device' to bootprio_find_fdc_device().
Kevin O'Connor [Sat, 9 Jul 2011 18:35:37 +0000 (14:35 -0400)]
Push use of 'struct pci_device' to bootprio_find_fdc_device().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoPush use of 'struct pci_device' to bootprio_find_pci_device().
Kevin O'Connor [Sat, 9 Jul 2011 18:33:56 +0000 (14:33 -0400)]
Push use of 'struct pci_device' to bootprio_find_pci_device().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoPush use of 'struct pci_device' to bootprio_find_usb().
Kevin O'Connor [Sat, 9 Jul 2011 18:31:50 +0000 (14:31 -0400)]
Push use of 'struct pci_device' to bootprio_find_usb().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoPush 'struct pci_device' into USB code (instead of using u16 bdf).
Kevin O'Connor [Sat, 9 Jul 2011 18:11:21 +0000 (14:11 -0400)]
Push 'struct pci_device' into USB code (instead of using u16 bdf).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoExtend tools/readserial.py to support serial port timing calibration.
Kevin O'Connor [Sat, 9 Jul 2011 17:16:24 +0000 (13:16 -0400)]
Extend tools/readserial.py to support serial port timing calibration.

Some serial ports have slightly different timing.  These timing
variations result in less accurate boot time reporting.  So, add a
calibration mechanism to the tool so that one can determine how much
time a specific machine's serial port uses.

Also, extend the main part of the tool to allow the user to specify
an exact timing parameter.

12 years agoFix jpeg decoder problem when it is used in 24 BPP mode.
Wayne Xia [Fri, 8 Jul 2011 03:03:16 +0000 (11:03 +0800)]
Fix jpeg decoder problem when it is used in 24 BPP mode.

Signed-off-by: Wayne Xia <xiawenc@linux.vnet.ibm.com>
12 years agoAdd an option to let seabios show BMP file as a logo.
Wayne Xia [Fri, 8 Jul 2011 03:02:09 +0000 (11:02 +0800)]
Add an option to let seabios show BMP file as a logo.

Signed-off-by: Wayne Xia <xiawenc@linux.vnet.ibm.com>
12 years agoAdd utility "tools/encodeint.py" for CBFS config file creation.
Kevin O'Connor [Wed, 6 Jul 2011 00:57:07 +0000 (20:57 -0400)]
Add utility "tools/encodeint.py" for CBFS config file creation.

12 years agoReplace CONFIG_SCREEN_AND_DEBUG with "etc/screen-and-debug" file.
Kevin O'Connor [Wed, 6 Jul 2011 00:56:07 +0000 (20:56 -0400)]
Replace CONFIG_SCREEN_AND_DEBUG with "etc/screen-and-debug" file.

12 years agoReplace CONFIG_S3_RESUME_VGA_INIT with "etc/s3-resume-vga-init" file.
Kevin O'Connor [Wed, 6 Jul 2011 00:50:32 +0000 (20:50 -0400)]
Replace CONFIG_S3_RESUME_VGA_INIT with "etc/s3-resume-vga-init" file.

12 years agoReplace "CONFIG_OPTIONROMS_CHECKSUM" with "etc/optionroms-checksum" file.
Kevin O'Connor [Wed, 6 Jul 2011 00:47:35 +0000 (20:47 -0400)]
Replace "CONFIG_OPTIONROMS_CHECKSUM" with "etc/optionroms-checksum" file.

12 years agoReplace CONFIG_PS2_KEYBOARD_SPINUP with "etc/ps2-keyboard-spinup" file.
Kevin O'Connor [Wed, 6 Jul 2011 00:44:00 +0000 (20:44 -0400)]
Replace CONFIG_PS2_KEYBOARD_SPINUP with "etc/ps2-keyboard-spinup" file.

12 years agoReplace CONFIG_EXTRA_PCI_ROOTS with dynamic "etc/extra-pci-roots" file.
Kevin O'Connor [Wed, 6 Jul 2011 00:40:11 +0000 (20:40 -0400)]
Replace CONFIG_EXTRA_PCI_ROOTS with dynamic "etc/extra-pci-roots" file.

12 years agoReplace CONFIG_BOOTMENU_WAIT with dynamic "etc/boot-menu-wait" file.
Kevin O'Connor [Wed, 6 Jul 2011 00:34:34 +0000 (20:34 -0400)]
Replace CONFIG_BOOTMENU_WAIT with dynamic "etc/boot-menu-wait" file.

12 years agoAdd "romfile" code to assist with extract integer config settings.
Kevin O'Connor [Wed, 6 Jul 2011 00:32:44 +0000 (20:32 -0400)]
Add "romfile" code to assist with extract integer config settings.

Add romfile_loadint() function which can be used to extract a
little-endian binary encoded integer from rom.

12 years agoReplace CONFIG_PCI_ROOT1/2 with CONFIG_EXTRA_PCI_ROOTS.
Kevin O'Connor [Sat, 2 Jul 2011 22:39:03 +0000 (18:39 -0400)]
Replace CONFIG_PCI_ROOT1/2 with CONFIG_EXTRA_PCI_ROOTS.

Instead of defining the bus id of each extra root bus, define the
number of extra root buses.  The bus id isn't necessarily stable from
one boot to the next.

12 years agoRename foreachbdf_in_bus to foreachbdf and simplify it.
Kevin O'Connor [Sat, 2 Jul 2011 18:49:41 +0000 (14:49 -0400)]
Rename foreachbdf_in_bus to foreachbdf and simplify it.

Now that all callers of foreachbdf have been converted to
foreachbdf_in_bus, simplify the pci_next() code - it no longer needs
to track PCI bridges.

Also, rename the remaining users of foreachbdf_in_bus to foreachbdf.

12 years agoConvert remaining callers of foreachbdf to foreachbdf_in_bus.
Kevin O'Connor [Sat, 2 Jul 2011 18:32:11 +0000 (14:32 -0400)]
Convert remaining callers of foreachbdf to foreachbdf_in_bus.

Convert the last few callers of foreachbdf to foreachbdf_in_bus.  This
is in preparation for simplification of foreachbdf_in_bus.

Also add in addition debugging messages to pci_probe.

12 years agoConvert pci_find_device/class to use 'struct pci_device'.
Kevin O'Connor [Sat, 2 Jul 2011 18:04:19 +0000 (14:04 -0400)]
Convert pci_find_device/class to use 'struct pci_device'.

12 years agoCalculate vgahook responses during setup instead of in 16bit code.
Kevin O'Connor [Sat, 2 Jul 2011 17:50:21 +0000 (13:50 -0400)]
Calculate vgahook responses during setup instead of in 16bit code.

Do vga type and parameter detection during setup and store the
necessary info in global variables for the 16bit code.  This
simplifies the "vgahook" 16bit code.

12 years agoUse 'struct pci_device' to note which devices have native drivers.
Kevin O'Connor [Wed, 22 Jun 2011 02:52:51 +0000 (22:52 -0400)]
Use 'struct pci_device' to note which devices have native drivers.

Remove the check in optionroms.c for CONFIG_ATA and
PCI_CLASS_STORAGE_IDE with a flag in 'struct pci_device'.  This
ensures devices using the ATA driver that aren't in
PCI_CLASS_STORAGE_IDE don't have their optionroms executed.  It also
allows other drivers to disable option rom execution in the future.

12 years agoConvert pci_init_device to use 'struct pci_device'.
Kevin O'Connor [Wed, 22 Jun 2011 02:41:15 +0000 (22:41 -0400)]
Convert pci_init_device to use 'struct pci_device'.

12 years agoMove pci_probe() call into pciinit() code.
Kevin O'Connor [Wed, 22 Jun 2011 02:22:58 +0000 (22:22 -0400)]
Move pci_probe() call into pciinit() code.

Call pci_probe after pci bridge setup and before pci device setup.
This will allow the pci device setup to use 'struct pci_device'.

12 years agoUse manual PCI search when making bios ram writable.
Kevin O'Connor [Wed, 22 Jun 2011 01:22:01 +0000 (21:22 -0400)]
Use manual PCI search when making bios ram writable.

During the ram unlock phase static variables can't be written, so
don't rely on the higher level PCI searching functions.  This will
allow for future simplification of those high level search functions.

This also limits the scan for the memory locking device to the first
bus - the device should also be on the root bus.

12 years agoReplace PCIPaths code with struct pci_device.
Kevin O'Connor [Tue, 21 Jun 2011 03:29:15 +0000 (23:29 -0400)]
Replace PCIPaths code with struct pci_device.

12 years agoConvert USB detection code to use struct pci_device.
Kevin O'Connor [Tue, 21 Jun 2011 02:23:02 +0000 (22:23 -0400)]
Convert USB detection code to use struct pci_device.

12 years agoConvert AHCI detection code to use struct pci_device.
Kevin O'Connor [Tue, 21 Jun 2011 02:22:42 +0000 (22:22 -0400)]
Convert AHCI detection code to use struct pci_device.

12 years agoConvert virtio detection to use struct pci_device.
Kevin O'Connor [Tue, 21 Jun 2011 02:22:08 +0000 (22:22 -0400)]
Convert virtio detection to use struct pci_device.

12 years agoConvert mptable code to use struct pci_device.
Kevin O'Connor [Tue, 21 Jun 2011 02:21:11 +0000 (22:21 -0400)]
Convert mptable code to use struct pci_device.

12 years agoConvert ATA detection code to use struct pci_device.
Kevin O'Connor [Tue, 21 Jun 2011 02:20:43 +0000 (22:20 -0400)]
Convert ATA detection code to use struct pci_device.

12 years agoConvert option rom scan to use struct pci_device.
Kevin O'Connor [Tue, 21 Jun 2011 02:19:17 +0000 (22:19 -0400)]
Convert option rom scan to use struct pci_device.

12 years agoRemove support for compiling in OPTIONROM_VENDEV_1/2.
Kevin O'Connor [Tue, 21 Jun 2011 01:52:44 +0000 (21:52 -0400)]
Remove support for compiling in OPTIONROM_VENDEV_1/2.

Passing in rom locations via absolute memory addresses hasn't been
needed since coreboot adopted CBFS support (which as several years
ago).

12 years agoFind all pci devices at startup and cache them for future use.
Kevin O'Connor [Sun, 19 Jun 2011 18:09:20 +0000 (14:09 -0400)]
Find all pci devices at startup and cache them for future use.

This adds 'struct pci_device' and pci_probe() which will locate and
store all found PCI devices in the system at startup.

12 years agoRename foreachpci macro to foreachbdf.
Kevin O'Connor [Sun, 19 Jun 2011 14:46:28 +0000 (10:46 -0400)]
Rename foreachpci macro to foreachbdf.

12 years agoAdd support for white-listing AHCI controllers as ATA compatible.
Kevin O'Connor [Sun, 19 Jun 2011 14:03:08 +0000 (10:03 -0400)]
Add support for white-listing AHCI controllers as ATA compatible.

To start, register the AMD ATA controller on the A50M chipset as
compatible with ATA mode even if it comes up in AHCI mode.

12 years agoConvert ATA pci scan to use pci_device_id table.
Kevin O'Connor [Sun, 19 Jun 2011 13:43:20 +0000 (09:43 -0400)]
Convert ATA pci scan to use pci_device_id table.

12 years agoRemove dev-i440fx.c/h - move code closer to its callers.
Kevin O'Connor [Sun, 19 Jun 2011 14:09:26 +0000 (10:09 -0400)]
Remove dev-i440fx.c/h - move code closer to its callers.

It's easier to understand the code when it is in the same file as its
callers.

12 years agoOnly allow CONFIG_XEN when not CONFIG_COREBOOT.
Kevin O'Connor [Wed, 15 Jun 2011 02:20:45 +0000 (22:20 -0400)]
Only allow CONFIG_XEN when not CONFIG_COREBOOT.

12 years agoCorrect fseg allocation for SMBIOS tables.
Ian Campbell [Tue, 14 Jun 2011 14:22:09 +0000 (15:22 +0100)]
Correct fseg allocation for SMBIOS tables.

Anthony Perard noticed that grub was unhappy because it sees no low memory and
that his e820 table was missing the first entry. He then pointed out this
rather glaring error in the allocation of space for the SMBIOS tables.

I've no idea why I didn't see this failure.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Tested-by: Anthony Perard <anthony.perard@citrix.com>
12 years agoAdd support for use as Xen HVM BIOS.
Ian Campbell [Wed, 1 Jun 2011 10:00:29 +0000 (11:00 +0100)]
Add support for use as Xen HVM BIOS.

SeaBIOS is called by Xen's hvmloader which does the basic platform
setup (PCI, APIC, etc) and provides the various BIOS tables. Therefore
avoid re-doing that setup and copy out the tables as necessary. A
simple data structure is defined to pass the addresses of these
tables.

This patch also establishes the basic infrastructure to make
hypercalls, although it currently only uses it to query the hypervisor
version.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
12 years agoMove support for copying out BIOS tables into its own file.
Ian Campbell [Wed, 1 Jun 2011 10:00:28 +0000 (11:00 +0100)]
Move support for copying out BIOS tables into its own file.

I'd like to use it for Xen support.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
12 years agoFix OHCI keyboard repeat key issue.
Kevin O'Connor [Sun, 29 May 2011 13:48:28 +0000 (09:48 -0400)]
Fix OHCI keyboard repeat key issue.

Mask toggleCarry and Halted flags in endpoint descriptor dword #2 so that
the remaining head pointer field is valid for comparing with the next
pointer.

Signed-off-by: Scott Duplichan <scott@notabs.org>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoOnly show CONFIG_PS2_KEYBOARD_SPINUP when CONFIG_COREBOOT.
Kevin O'Connor [Sat, 28 May 2011 15:01:39 +0000 (11:01 -0400)]
Only show CONFIG_PS2_KEYBOARD_SPINUP when CONFIG_COREBOOT.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoAdd option to handle PS2 keyboards that have a slow power up.
Kevin O'Connor [Sat, 28 May 2011 15:00:28 +0000 (11:00 -0400)]
Add option to handle PS2 keyboards that have a slow power up.

Add PS2_KEYBOARD_SPINUP option to give certain keyboards more time to
initialize.

Based on report and feedback from: Sven Schnelle <svens@stackframe.org>

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agofix resume from S3 with QXL device
Kevin O'Connor [Wed, 25 May 2011 02:35:40 +0000 (22:35 -0400)]
fix resume from S3 with QXL device

From: Gleb Natapov <gleb@redhat.com>

QXL device is powered down during S3, so tell this to a guest OS
in AML code.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
12 years agoCheck for broken LD that ships with Ubuntu 11.04.
Kevin O'Connor [Sun, 22 May 2011 01:05:04 +0000 (21:05 -0400)]
Check for broken LD that ships with Ubuntu 11.04.

Add a build test to ensure that LD can properly align sections.

13 years agoPrint E820 type names as well as numbers, as a debug aid
Ian Campbell [Fri, 13 May 2011 15:30:55 +0000 (16:30 +0100)]
Print E820 type names as well as numbers, as a debug aid

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
13 years agoAdd Kconfig option to specify which serial port when serial debugging.
Kevin O'Connor [Wed, 11 May 2011 03:36:11 +0000 (23:36 -0400)]
Add Kconfig option to specify which serial port when serial debugging.

13 years agoAdd config option (CONFIG_BOOTORDER) to disable bootorder support.
Kevin O'Connor [Wed, 11 May 2011 02:08:30 +0000 (22:08 -0400)]
Add config option (CONFIG_BOOTORDER) to disable bootorder support.

13 years agoMove ps2ctr manipulation from mouse.c to ps2port.c.
Kevin O'Connor [Sat, 7 May 2011 18:19:29 +0000 (14:19 -0400)]
Move ps2ctr manipulation from mouse.c to ps2port.c.

This simplifies the mouse.c code.  It also prevents USB mouse
interaction from changing the ps2 port setup.