Commit Graph

1062 Commits

Author SHA1 Message Date
Kevin O'Connor 2e8bd611ce Update version to 1.6.3.2
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-03-11 09:27:07 -04:00
Kevin O'Connor b918ac965b Use "#!/bin/sh" instead of ":" in tools/gen-offsets.sh.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-03-05 18:41:52 -05:00
Kevin O'Connor 982c6f9bac Fix missing NULL pointer checks causing boot failure on 1meg machines.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-03-05 18:39:31 -05:00
Kevin O'Connor 97e902dbfd BCVs should inherrit the legacy harddrive priority.
A BCV will (almost assuredly) be a hard drive, so it makes sense to
prioritize them the same as builtin hard drives when only the legacy
priority system is used.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-03-05 18:37:38 -05:00
Kevin O'Connor c69e288adf Permit .rodata.__PRETTY_FUNCTION__. sections in roms.
Some versions of gcc appear to define these sections even though they
aren't used in the code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
(cherry picked from commit 805ede2bd3)

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2012-02-22 12:44:09 +00:00
Kevin O'Connor 002d30b5f4 Add PYTHON definition to Makefile.
Add PYTHON definition to Makefile so users can override it.  This
allows users to specify an exact python executable name to use during
the build.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
(backported from 97f1ffcfac)
2012-02-22 11:46:39 +00:00
Kevin O'Connor 80d11e8577 Update version to 1.6.3.1
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-11-24 12:02:03 -05:00
Paolo Bonzini a3fea01539 usb: fix boot paths
The fw paths for USB devices that SeaBIOS computes are off-by-one,
because QEMU builds those paths with a numbering that starts from one
(see usb_fill_port and usb_hub_initfn in QEMU).  Fix that so that
the numbering agrees.
2011-11-24 12:01:07 -05:00
Kevin O'Connor e66fb31eac Update version to 1.6.3 2011-10-04 21:14:09 -04:00
Kevin O'Connor 0fdf193a3e Update README file. 2011-10-04 21:12:28 -04:00
Kevin O'Connor 3c5fcec00c 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>
2011-10-01 12:42:51 -04:00
Kevin O'Connor d2deae203d 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>
2011-10-01 10:54:54 -04:00
Jan Kiszka 58e6b3ff51 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>
2011-10-01 10:53:39 -04:00
Kevin O'Connor 9acdc28d5d 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>
2011-09-20 19:42:14 -04:00
Kevin O'Connor 7859edaaba 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>
2011-09-20 19:40:28 -04:00
Kevin O'Connor 8a161c9f5a Minor formatting and comment updates to acpi.c. 2011-09-02 18:11:58 -04:00
Jan Kiszka b8a90f513b 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>
2011-09-02 18:04:04 -04:00
Kevin O'Connor 83012de164 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.
2011-08-28 12:42:15 -04:00
Gerd Hoffmann 8e301472e3 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>
2011-08-09 22:54:35 -04:00
Gerd Hoffmann ceb8ed4ef2 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>
2011-08-06 14:11:12 -04:00
Gerd Hoffmann ef8adc0220 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>
2011-08-06 13:57:53 -04:00
Gerd Hoffmann 2dcbf7fafc 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>
2011-08-06 13:57:53 -04:00
Gerd Hoffmann 263ea2f205 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>
2011-08-06 13:57:53 -04:00
Gerd Hoffmann 9713f2418f 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>
2011-08-06 13:57:53 -04:00
Gerd Hoffmann d7a7cf3a43 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>
2011-08-06 13:57:52 -04:00
Kevin O'Connor 32f03876f4 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.
2011-08-03 20:45:32 -04:00
Kevin O'Connor 8b9137d295 Allow free space in f-segment to be used by malloc_fseg(). 2011-08-03 20:15:26 -04:00
Kevin O'Connor e0f87ce661 Warn if not enough space in smp_mtrr array. 2011-07-29 19:21:07 -04:00
Marcelo Tosatti bbce6d63c1 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>
2011-07-29 19:17:34 -04:00
Gerd Hoffmann 9c8699290b 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>
2011-07-24 23:28:57 -04:00
Gerd Hoffmann e104119d4c 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>
2011-07-24 23:28:57 -04:00
Gerd Hoffmann cbda795db4 ahci: don't expect ATA_CB_STAT_DRQ being clear
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-24 23:28:57 -04:00
Scott Duplichan 9c48aab016 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>
2011-07-24 23:28:57 -04:00
Gerd Hoffmann 6f85049296 ahci: add error recovery code
By Scott Duplichan.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-24 23:28:57 -04:00
Gerd Hoffmann 0753297132 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>
2011-07-24 23:28:57 -04:00
Gerd Hoffmann a8c6a4e820 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>
2011-07-24 23:28:57 -04:00
Ian Campbell 7fc039e9c2 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>
2011-07-20 20:39:36 -04:00
Kevin O'Connor 1313b78a5b 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>
2011-07-16 13:52:03 -04:00
Kevin O'Connor 533b6286cb 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>
2011-07-16 13:15:27 -04:00
Gerd Hoffmann 77b8536e5c 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>
2011-07-12 21:14:53 -04:00
Gerd Hoffmann 60a348bfbd pci: cleanup config.h
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-12 21:14:52 -04:00
Gerd Hoffmann 3bbd11f005 pci: remove old pci initilaization code
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-12 21:14:52 -04:00
Gerd Hoffmann 01a5c8813b 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>
2011-07-12 21:14:52 -04:00
Gerd Hoffmann 82b39b286e 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>
2011-07-12 21:14:52 -04:00
Kevin O'Connor 871c92991b Updates to TODO list. 2011-07-12 21:14:10 -04:00
Kevin O'Connor e434e3134b Fix compile error - remove bmp.c from being compiled twice. 2011-07-12 21:09:23 -04:00
Kevin O'Connor 47c8e31d36 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>
2011-07-10 22:57:32 -04:00
Kevin O'Connor 87b533bf71 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>
2011-07-10 22:35:07 -04:00
Kevin O'Connor ffdcd3a8d7 Minor fix - check for malloc failure in USB cntl allocation.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-07-10 15:48:00 -04:00
Kevin O'Connor 6f500511dc 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>
2011-07-10 15:41:55 -04:00