Commit Graph

2696 Commits

Author SHA1 Message Date
Kevin O'Connor a9cf782445 pciinit: Use %pP shorthand for printing device ids in intel_igd_setup()
The hardcoded device names can cause false-positives on Windows bios
version checks.  Use the %pP format to avoid that.

Reported-by: Sam Eiderman <shmuel.eiderman@oracle.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-05-23 11:28:25 -04:00
Gerd Hoffmann 0932c20560 optionrom: disallow int19 redirect for pnp roms.
Check whenever pnp roms attempt to redirect int19, and in case it does
log a message and undo the redirect.

A pnp rom should not need this, we have BEVs and BCVs for that.
Nevertheless there are roms in the wild which are redirecting int19.
At least some BIOS implementations for physical hardware have a config
option in the setup to allow/disallow int19 redirections, so just not
allowing this seems to be the way to deal with this situation.

Buglink: https://bugzilla.redhat.com//show_bug.cgi?id=1642135
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Tested-by: Matt DeVillier <matt.devillier@gmail.com>
2019-05-22 08:01:20 +02:00
Gerd Hoffmann 18d237b4e4 bootmenu: add support for more than 9 entries
10th and following entries can be selected using letters.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-05-17 14:56:42 +02:00
Gerd Hoffmann 8acad25cd5 add get_keystroke_full() helper
Switch get_raw_keystroke() to return ax instead of ah, so it returns
both scan code and ascii code of the key pressed.

Add get_keystroke_full() function which passes up ax to the caller.

The get_keystroke() function continues to return the scancode only like
it did before.  It is a thin wrapper around get_keystroke_full() now
though.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-05-17 14:56:42 +02:00
Gerd Hoffmann a3fd63c234 bochsdisplay: parse resolution from edid.
Then use the resolution for the framebuffer.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-05-15 10:11:48 +02:00
Gerd Hoffmann 2f87fe393c bochsdisplay: add edid support.
Read EDID blob from mmio bar, store in VBE_edid.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-05-15 10:11:48 +02:00
Gerd Hoffmann 083801db10 bochsvga: add edid support.
Read EDID blob from mmio bar, store in VBE_edid.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-05-15 10:11:48 +02:00
Gerd Hoffmann 588eb12163 ati: add edid support.
Read EDID blob via i2c, store in VBE_edid.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-05-15 10:11:48 +02:00
Gerd Hoffmann a307d0adc5 vbe: add edid support.
VBE subfunction 0x15, read ddc data.

Add VBE_edid where drivers can fill in a EDID data blob.
If we find valid data there (checking the first two header
bytes), then report the function as supported and hand out
the data.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-05-15 10:11:48 +02:00
Sam Eiderman 55eca9a14a smbios: Add missing zero byte to Type 0
According to SMBIOS Specification, section 6.1.3 Text Strings:
"Text strings associated with a given SMBIOS structure are returned in
the dmiStructBuffer, appended directly after the formatted portion of the
structure. This method of returning string information eliminates the
need for application software to deal with pointers embedded in the
SMBIOS structure. Each string is terminated with a null (00h) BYTE and
the set of strings is terminated with an additional null (00h) BYTE”

Furthermore:
"If the formatted portion of the structure contains string-reference
fields and all the string fields are set to 0 (no string references),
the formatted section of the structure is followed by two null (00h)
BYTES"

From the above it can be seen that any SMBIOS type which contains string
references should end with an additional zero byte.

This is currently handled in all SMBIOS types which use
load_str_field_with_default() besides type0.
Therefore, add the missing zero byte to SMBIOS Type 0.

Running QEMU with:
    -machine pc-i440fx-2.0 (for legacy smbios)
    -smbios type=0,vendor=,version=,date= (for zero str_index)
Will cause SMBIOS type0 entry to overrun type1 entry.

Reviewed-by: Mark Kanda <mark.kanda@oracle.com>
Reviewed-by: Ross Philipson <ross.philipson@oracle.com>
Reviewed-By: Liran Alon <liran.alon@oracle.com>
Signed-off-by: Sam Eiderman <shmuel.eiderman@oracle.com>
2019-05-07 10:38:37 -04:00
Gerd Hoffmann f4c6e4c19d vga: add ati bios tables
Needed to make drivers happy which try to gather
informations from these tables.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-03-15 09:59:25 +01:00
Gerd Hoffmann 34b6ecc160 vga: add atiext driver
Supports qemu emulated ati cards.  They have been added in qemu 4.0.
Acceleration support (in qemu) is pretty rough still.  A simple
framebuffer works fine though.

Available models:
 * ati rage 128 pro
 * ati rv100

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-03-15 09:59:21 +01:00
Gerd Hoffmann 03f5061c0a vga: make memcpy_high() public
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-03-14 13:07:27 +01:00
Gerd Hoffmann 004f5b3ae5 vga: move modelist from bochsvga.c to new svgamodes.c
So other drivers can simply use the same list too.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-03-14 13:07:17 +01:00
Stefan Berger 171fc8979d tcgbios: Implement TPM 2.0 menu item to activate and deactivate PCR banks
Implement a TPM 2.0 menu item that allows a user to toggle the activation
of PCR banks of the TPM 2.0. After successful activation we shut down the
TPM 2.0 and reset the machine.

Background:

A TPM 2.0 may have multiple PCR banks, such as for SHA1, SHA256, SHA384,
SHA512, and SM3-256. One or multiple of those banks may be active (by
factory for example) and modifying the set of active PCR banks is only
possible while in the firmware since it requires platform authorization.
Platform authorization is not possible for a user when in the OS since
the firmware generates a random password for the platform authorization
before booting the system and it throws that password away.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-02-04 21:23:37 -05:00
Stefan Berger b7dbd200cf tcgbios: Use table to convert hash to buffer size
Use a table to convert the hash to the buffer size it needs.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-02-04 21:23:37 -05:00
Kevin O'Connor 996d3c0297 usb-ehci: Clear pipe token on pipe reallocate
Make sure to clear the token before reuse as it may otherwise have an
incorrect toggle setting.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-04 21:22:15 -05:00
Joseph Pacheco-Corwin 63d6967466 bootsplash: Added support for 16/24/32bpp in one function
Specifically added support for 16 and 32bpp files, in addition to
24bpp.  The function bmp_show() in bmp.c has had the hardcoded check
for 24bpp replaced with a general bpp check that uses a % to check for
remainder, and returns 1 if the remainder is >0.  The previous method
for adjusting the BMP data (raw_data_format_adjust_24bpp) relied on a
preset 3*bytes_per_line_src, this has been changed and the
multiplication is now performed in the function's arguments. This
change still allows someone else to reuse the same function for
1/2/4bpp support if necessary. The file util.h has been modified to
reflect this decision.

The changes to raw_data_format_adjust() is based on an abandoned patch
by Gert Menke (submitted March 14, 2017), credit to them for that
change and the addition of *bpp to bmp_get_info().

Signed-off-by: Joseph S. Pacheco-Corwin <hammersamatom@gmail.com>
2019-02-04 21:20:27 -05:00
Kevin O'Connor 34fe8660ec docs: Fix cut-and-paste error in Mailinglist.md archive link
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-21 13:17:11 -05:00
Kevin O'Connor d62ca8c9c5 docs: Update mailing list archive links
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-20 12:05:36 -05:00
Kevin O'Connor 29ba89e67f output: Avoid thunking to 16bit mode in printf() if no vgabios
It is not necessary to call the vgabios if no vgabios has been
installed.  This reduces the amount of hardware accesses on qemu when
the bios is not initializing the display hardware, and it can reduce
the boot time by a couple of milliseconds.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-12-17 10:23:49 -05:00
Stefano Garzarella 75b4283513 qemu: avoid debug prints if debugcon is not enabled
In order to speed up the boot phase, we can check the QEMU
debugcon device, and disable the writes if it is not recognized.

This patch allow us to save around 10 msec (time measured
between SeaBIOS entry point and "linuxboot" entry point)
when CONFIG_DEBUG_LEVEL=1 and debugcon is not enabled.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-12-10 22:03:30 -05:00
Liran Alon 628b2e6b0e pvscsi: ring_desc do not have to be page aligned
In contrast to other allocations made by pvscsi_init_rings(),
ring_desc is only used internally by SeaBIOS (not passed to
device-controller) and there is not restriction which force
it to be page aligned.

Reviewed-by: Mark Kanda <mark.kanda@oracle.com>
Signed-off-by: Liran Alon <liran.alon@oracle.com>
2018-11-27 21:19:49 -05:00
Stephen Douthit 42efebdf1d tpm: Check for TPM related ACPI tables before attempting hw probe
Signed-off-by: Stephen Douthit <stephend@silicom-usa.com>
2018-11-27 21:02:49 -05:00
Kevin O'Connor a698c8995f docs: Note v1.12.0 release
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-17 11:05:59 -05:00
Kevin O'Connor 693a88eaa8 shadow: Rework bios copy code to prevent gcc array-bounds warning
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-10 13:47:56 -05:00
Shmuel Eiderman b44803247c pvscsi: Scan all 64 possible targets
The max number of targets per PVSCSI controller is 64, not 7.
This can easily be seen in QEMU PVSCSI emulation code
(hw/scsi/vmw_pvscsi.c) as PVSCSI_MAX_DEVS, which defines the
number of targets, have value of 64.

Fixes: 83d60b3c47 ("Add pvscsi boot support")

Reviewed-by: Liran Alon <liran.alon@oracle.com>
Reviewed-by: Mark Kanda <mark.kanda@oracle.com>
Signed-off-by: Shmuel Eiderman <shmuel.eiderman@oracle.com>
2018-11-10 13:07:29 -05:00
Gerd Hoffmann 14221cd86e pretty boot menu entry for cdrom drives
Show the volume label of bootable cdroms.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2018-10-05 13:28:27 +02:00
Matt DeVillier bf8e4f902c SeaVGABios/cbvga: Fix bpp for coreboot framebuffer
Commit 4b42cc4 [SeaVGABios/cbvga: Advertise correct pixel format] neglected
to wrap the cbfb mask size components in GET_FARVAR(), which resulted in a
bogus value for bpp, breaking output on most/all devices.  Fix this by
adding GET_FARVAR() as appropriate.

Additionally, some newer ChromeOS devices still fail even with this fix,
so fall back to using the coreboot reported bit depth if the calculated
valid is invalid.

TEST: build/boot a variety of devices (google/[reef,eve], purism/librem_skl)
using coreboot framebuffer init, verify SeaBIOS boot menu prompt visible.

Signed-off-by: Matt DeVillier <matt.devillier@puri.sm>
2018-09-18 13:35:30 -04:00
Jing Liu bcd82420a3 pci: recognize RH PCI legacy bridge resource reservation capability
Enable the firmware recognizing RedHat legacy PCI bridge device ID,
so QEMU can reserve additional PCI bridge resource capability.
Change the debug level lower to 3 when it is non-QEMU bridge.

Signed-off-by: Jing Liu <jing2.liu@linux.intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Marcel Apfelbaum<marcel.apfelbaum@gmail.com>
Message-id: 1535100781-3910-4-git-send-email-jing2.liu@linux.intel.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2018-09-05 08:37:18 +02:00
Jing Liu 478bc3e993 pci: clean up the debug message for pci capability found
Improve the debug message when QEMU resource reserve cap
is not found and when the vendor-id or device-id does't match
REDHAT special ones.

Signed-off-by: Jing Liu <jing2.liu@linux.intel.com>
Message-id: 1535100781-3910-3-git-send-email-jing2.liu@linux.intel.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2018-09-05 08:37:18 +02:00
Jing Liu 2c455ccc0c pci: fix the return value for truncated capability
Return zero when finding truncated capability.

Signed-off-by: Jing Liu <jing2.liu@linux.intel.com>
Message-id: 1535100781-3910-2-git-send-email-jing2.liu@linux.intel.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2018-09-05 08:37:18 +02:00
Kevin O'Connor e4db8c6db9 sdcard: Increase SDHCI_POWER_ON_TIME to 5ms
It appears some sd cards need additional time to initialize after
power on.

Reported-by: Chris <coderight@gmail.com>.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-03 17:32:44 -04:00
Matt DeVillier 7961917493 nvme: fix I/O queue length calculation overflow
Commit cd47172 changed the I/O queue length calculation to use the
Maximum Queue Entries Supported (MQES) value from the capabilities
register, plus one, with a maximum value of NVME_PAGE_SIZE.

An unintended effect from this is that due to length being an unsigned
16-bit int, a MQES value of 0xFFFF yields a length of zero, resulting
in the queue allocation failing. Fix this by changing length to a u32.

TEST: build/boot on a Purism Librem13v2 with a MyDigitalSSD BPX NVMe
drive, which reports a MQES of 0xFFFF. Verify NVMe drive present in
boot menu and OS boots successfully.

Signed-off-by: Matt DeVillier <matt.devillier@puri.sm>
2018-08-23 10:23:21 -04:00
Kevin O'Connor 95f850c237 docs: Update download file link
Released versions are now at: https://www.seabios.org/downloads/

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-09 08:29:20 -04:00
Kevin O'Connor 8c3f57ea12 ssdt: Fix building of legacy acpi tables on current iasl compiler
Recent versions of the iasl compiler raise an error if the table id is
longer than 8 characters.  Older versions of iasl would silently
truncate the table id to 8 characters.  Change the ssdt-misc and
ssdt-pcihp files to use an 8 character id - this should not directly
impact the generated aml code as the table id was already being
truncated - but may help those wishing to manually compile the tables.

Reported by Michael Tokarev, Vivia Nikolaidou, and several others.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-15 10:14:15 -04:00
Gerd Hoffmann 69ea6dabeb cbvga_set_mode: refine clear display logic
There is no need to skip text mode clearing.
Clearing the framebuffer should be safe on legacy calls too.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2018-06-26 09:16:31 +02:00
Gerd Hoffmann d9a8b867a3 qemu: add qemu ramfb support
Add support for qemu ramfb.  This is a simple boot framebuffer device,
with normal ram being used to back the framebuffer and fw_cfg being used
to configure the device.

Use case (on x86): boot display for vgpu devices (which neither emulate
vga nor have a vgabios).

Sharing fw_cfg code with seabios turned out to be difficuilt due to
various dependencies the code has on infrastructure which only seabios
has.  So include a copy of the code here, with those dependencies
removed and also stripped down because we don't need a non-dma fallback
here.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2018-06-22 07:44:07 +02:00
Gerd Hoffmann e1a9579acd vgasrc: add allocate_pmm()
Factor out pmm allocation function from stack allocator.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2018-06-22 07:44:07 +02:00
Gerd Hoffmann a638acfa4c pmm: use tmp zone on oom
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2018-06-22 07:44:07 +02:00
Gerd Hoffmann 7bf9ffff1a bochs_display_setup: return error on failure
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2018-06-22 07:44:07 +02:00
Gerd Hoffmann ddbb6da350 cbvga_set_mode: disable clearmem in windows x86 emulator.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2018-06-22 07:44:07 +02:00
Gerd Hoffmann 0c2b3b1d95 cbvga_list_modes: don't list current mode twice
In case we've already added the framebuffer video mode
to the list do not add number 0x140.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2018-06-22 07:44:07 +02:00
Gerd Hoffmann 902bacb5f0 cbvga_setup_modes: use real mode number instead of 0x140
In case the framebuffer size matches one of the cbvga video modes
just use that mode number instead of 0x140.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2018-06-22 07:44:07 +02:00
Gerd Hoffmann 77404b450d qemu: add bochs-display support
Use coreboot text mode emulation to also support the qemu bochs-display
device.  This is a new display device supporting simple linear
framebuffers, using the bochs register interface.  No support for legacy
vga (text modes, planar modes, cga modes, 8bpp palette modes all
dropped).  The bochs interface is compatible with the qemu stdvga.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2018-06-22 07:44:07 +02:00
Gerd Hoffmann 4d70b24b86 cbvga: factor out cbvga_setup_modes()
Factor out generic data structure setup code from cbvga_setup().

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2018-06-22 07:44:07 +02:00
Gerd Hoffmann e28e0bb39b optionrom: enable non-vga display devices
In case no VGA device was found look for other display devices.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2018-06-22 07:44:07 +02:00
Kevin O'Connor 237fd3943d docs: Update Download.md to use git clone via https
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-11 12:05:31 -04:00
Stefan Berger d1343e6863 tpm: Request access to locality 0
The CRB driver has to request access to locality 0. Our QEMU
CRB model will enforce that as well.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-04-12 15:20:36 -04:00
Stefan Berger 4922d6cb39 tpm: when CRB is active, select, lock it, and check addresses
Do not just indicate that the probing for the CRB interface was successful
if we find it active. Instead, select it, lock it, and test the addresses
for whether they can be used (must be 32 bit).

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-03-21 10:35:54 -04:00