Commit Graph

149 Commits

Author SHA1 Message Date
Sam Demeulemeester
eac4d03462 Parse FADT to find ACPI Timer Base Address and specs 2022-06-19 16:39:03 +02:00
Sam Demeulemeester
cee2d32766 Add a few ACPI Tables Signature that could be useful later 2022-06-19 16:39:03 +02:00
Sam Demeulemeester
221a66da1a Split ACPI Functions from SMP functions.
Add ACPI Table detection for FADT & HPET (as we need better timers)
2022-06-19 16:39:03 +02:00
Lionel Debroux
63a07258fd Fix the operation of the SMBus functions which require the SMBus controller ID. 2022-06-08 18:00:50 +02:00
Sam Demeulemeester
7758adfb9d Improve readability on disabled code 2022-06-06 22:24:09 +02:00
Sam Demeulemeester
106eabef98 Fuse HYGON and AMD because the SMB controllor is strictly identical on both 2022-06-06 22:24:09 +02:00
Lionel Debroux
e86b04a14a Perform major simplification in smbus.c to reduce code size while keeping the functions readable, removing several unused strings and unnecessary arguments passed to several functions.
Add a bunch of PCI device IDs and driver indications for other SMBus controllers, so as to avoid other persons having to do that work again.
Add support for two PIIX4 devices: the standard PIIX4 PCI device ID, and the ServerWorks CSB5, which has a slight twist.

Co-authored-by: Lionel Debroux <lionel_debroux@yahoo.fr>
Co-authored-by: Sam Demeulemeester <sam@x86.fr>
2022-06-06 22:24:09 +02:00
Sam Demeulemeester
6cd356f831 Add External L2 detection for ALi Aladdin V Chipset (#87) 2022-06-06 19:56:04 +02:00
Sam Demeulemeester
fa563a8cb2 Change the way hwquirks are processed. Add a pointer to the needed function on quirk struct, so it can be executed at any point of the code 2022-06-05 14:36:56 +02:00
Sam Demeulemeester
e1508a02be Better detection of AMD SBxxx Southbridge using Revision IDs.
Add support for nForce 600a & 700a series
2022-05-25 01:11:11 +02:00
Sam Demeulemeester
69aeda1c27 Discard Memory SKU when filled with 0xFF. Remove a debug function forgotten there 2022-05-24 01:13:37 +02:00
Sam Demeulemeester
7c969db4da Add support for nVidia nForce2 MCP (#86) 2022-05-24 01:00:52 +02:00
Sam Demeulemeester
1383f871d8 Add preliminary support for RPL-S PCH 2022-05-23 01:09:13 +02:00
Sam Demeulemeester
67cb78f4e5 Add support for AMD/ATI Southbridge (SB600->SB900) 2022-05-22 18:33:49 +02:00
Martin Whitaker
3a107018e5 Reset EHCI controller after port scan if no keyboards are found.
Low and full speed USB devices that are attached directly to an EHCI port
have to be handled by a companion controller (either UHCI or OHCI). We hand
over ports when we detect a low or full speed device is attached by setting
the Port Owner bit in the Port Status and Control register. However some AMD
companion controllers fail to detect the device after this has been done.
Resetting the EHCI controller works around this quirk.

This fixes issue #6 and issue #71.
2022-05-21 20:22:03 +01:00
Sam Demeulemeester
dce2cfb079 Fix a detection issue caused by some Pre-ZEN AMD CPUs sometimes incorrectly reporting SMT as supported 2022-05-21 01:31:06 +02:00
Sam Demeulemeester
3bc72c1fd4 Remove unused strings and useless smb_idx argument in get_spd() 2022-05-20 19:10:00 +02:00
Sam Demeulemeester
e0cee8e2c3 Add SMBUS support for Intel 82371AB (PIIX4) and AMD Bulldozer/Kabini (SB800/900) 2022-05-20 18:07:22 +02:00
Sam Demeulemeester
6b253adb9a Include unistd.h in pci.c to use usleep() 2022-05-20 13:46:29 +02:00
Sam Demeulemeester
bc8235f50d
Add a way to handle hardware quirks at init or later in the code. Add ASUS TUSL2-C ASB100 Mux as (working) example (#77) 2022-05-20 13:23:25 +02:00
Sam Demeulemeester
d901f9e8a1 Fix an issue where DDR4 Bank switch fail because DMI tables have multiples Type 17 structs reporting unpopulated slots as Type 2 (unknown), overwriting the valid struct with the populated slot. Code cleanup to improve readability 2022-05-20 01:59:27 +02:00
Lionel Debroux
caa07482a0 Reorganize struct spd_infos for better alignment (#2), fix left shifts of count > width of type, fix whitespace, improve comments. 2022-05-19 18:45:13 +02:00
Sam Demeulemeester
c2d033b4b4 Correct tCL detection on SDRAM 2022-05-19 17:16:13 +02:00
debrouxl
c1d0c17f23 Add SPD decoding for SDRAM. 2022-05-19 15:07:09 +02:00
Sam Demeulemeester
37edb221d7 Importing minor bug fixes in smbus.c from delayed PR #44
Co-authored-by: 01e3 <01e3@ans.pl>
Co-authored-by: debrouxl <lionel_debroux@yahoo.fr>
2022-05-19 12:01:05 +02:00
Martin Whitaker
eaf29f1e39 Mark keyboard reports passed to process_usb_keyboard_report() as const. 2022-05-01 22:43:04 +01:00
Martin Whitaker
260c113bb2 Detect and ignore the HID keyboard "phantom condition" (excessive roll-over). 2022-05-01 22:40:42 +01:00
Martin Whitaker
ddaa8bff3f uhci: update the data toggle bit when reenabling an interrupt transfer.
For the same reason as the preceeding ehci fix.
2022-05-01 22:05:40 +01:00
Martin Whitaker
f7d31df412 ehci: update the data toggle bit when reenabling an interrupt transfer.
Previously every second transfer was dropped. We didn't notice, because
they were normally key release events, which we ignored anyway. However
the new keyboard report handler needs to see the release events.
2022-05-01 18:27:13 +01:00
Martin Whitaker
c3bdb556d1 Move probe_usb_controller() into private functions section of usbhcd.c
No functional change. It was just in the wrong place.
2022-05-01 18:24:39 +01:00
Martin Whitaker
97d6c7140d Improved USB keyboard report handling.
A USB keyboard may return key codes in any of the 6 key code array
positions (issue #48). So we have to compare the latest report to
the previous one to detect new key presses and handle rollover. As
the same change is needed for all HCI types, factor out the common
code into the base driver.
2022-05-01 16:44:46 +01:00
Martin Whitaker
3aebe091cb xhci: mark legacy support regs as volatile and preserve reserved bits. 2022-05-01 11:49:39 +01:00
Martin Whitaker
8284e98761 Don't disable bus master capability when probing USB PCI configuration.
That can cause the SMM to freeze the system when legacy support is
enabled on some AMD XHCI controllers (issue #56).
2022-04-30 11:30:00 +01:00
martinwhitaker
93c9c8ded5
Rework memory mapping to allow for larger program size (#54)
* Improve abstraction in vmem.h and limit memory benchmarking to first 2GB.

The third GB may get used for remapping memory regions that are only
accessed during startup, so it's not safe to use it for the memory
speed tests.

* Fix calculation of end limit for locating memory benchmark workspace.

* Document vmem.h.

* Use window number, not current start address, to detect first window.

* Increase the program low-load range from 1MB to 4MB and make more robust.

If the BIOS has reserved some parts of low memory, there may not be
enough contiguous space left to load the program there (issue #49).
So increase the low-load range to include the first 3MB of high
memory. Also guard against the program being initially loaded
straddling the new boundary.

Co-authored-by: Martin Whitaker <memtest@martin-whitaker.me.uk>
2022-04-28 23:04:01 +02:00
Martin Whitaker
e0c0cd55c6 Tidy up code for performing reset via the EFI runtime sevices.
Make this entirely local to hwctrl.c.
2022-04-23 13:25:33 +01:00
Martin Whitaker
faab0a321d Only look for the RDSP in the appropriate EFI system table.
We don't support mixed-mode boot, so we will never find a 32-bit EFI
system table when running from a 64-bit binary.
2022-04-23 09:16:42 +01:00
Martin Whitaker
80bb3f452d ohci: fix startup when the controller is in SUSPEND or RESUME state. 2022-04-23 08:57:55 +01:00
Martin Whitaker
0bd19d9d91 ohci: rename variable used to preserve the frame interval.
For code clarity. No functional change.
2022-04-23 08:49:30 +01:00
Martin Whitaker
0939c5e127 Work around bug in SiS OHCI controllers (issue #43).
The SiS OHCI controller ignores writes to its FmInterval and PeriodicStart
registers when in SUSPEND state, so delay initialisation of these registers
until after we start the controller running.
2022-04-23 08:37:42 +01:00
Sam Demeulemeester
2a7631daab Enumerate all XMP 3.0 profiles on DDR5 to find the fastest. Solve a rounding issue with DDR5 timings 2022-04-22 00:49:54 +02:00
Martin Whitaker
644a13c730 Add usbdebug command line option and conditionally pause at end of USB scan.
If the usbdebug option is present, pause at the end of the USB scan until
a key is pressed. Otherwise, if the keyboard=usb option is present and no
USB keyboards were discovered, pause for 10 seconds. Otherwise don't pause.
2022-04-17 22:46:17 +01:00
Sam Demeulemeester
3ac3aa995e Add detection for some manufacturers related to RDRAM 2022-04-16 18:38:32 +02:00
Sam Demeulemeester
be9502ac01 Add detection for Rambus RDRAM modules & support for ICH1/2/3 2022-04-16 18:36:58 +02:00
Sam Demeulemeester
fec8bc258b Correct SMT/HTT flag according to AP-485 2022-04-16 18:34:49 +02:00
Lionel Debroux
ea6e32cb48
Add support for parsing DMI struct type 1 (System Information), whose presence is mandatory, and use it as fallback for DMI struct type 2 (Baseboard Information), which often gives more useful data, but is optional. Fixes part of issue #36. (#39) 2022-04-16 13:40:50 +02:00
Sam Demeulemeester
2a994e7ff5 Various code cleanup following PR review 2022-04-16 13:31:28 +02:00
Sam Demeulemeester
eae5dd2796 Correct TTY to match the new temperature location on display 2022-04-16 13:31:28 +02:00
Sam Demeulemeester
6fca9bedc9 Rework Line 9. Add DDR1->DDR5 Timing Detection to display on this line 2022-04-16 13:31:28 +02:00
Sam Demeulemeester
979b85548d Rework Line #7 left block. Add preliminary CPUID function to detect CPU Topology 2022-04-16 13:31:28 +02:00
Martin Whitaker
2cd060b22c Fix warning about mismatched comparison operands in 32-bit build. 2022-04-13 14:20:46 +01:00