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.
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.
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.
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.
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.
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>
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.
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>
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.
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>
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>
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.
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.
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.
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.
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.
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>
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>
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>