Commit Graph

411 Commits

Author SHA1 Message Date
Sam Demeulemeester 03b6cbe4e4 Add IMC polling for AMD Rembrandt
Refactor cpuinfo() for AMD Family 19h CPUs and add detection for AMD Chagall, Storm Peak, Rembrandt, Phoenix and Granite Ridge
2023-06-01 22:00:02 +02:00
Sam Demeulemeester 43aab9d231
Fix GitHub Actions 404 Errors due to lack of apt-get update (#312) 2023-05-21 00:26:28 +02:00
Jonathan Teh a1ef11c3ba
cpuinfo: Add support for Vortex86 (#290)
* cpuinfo: Add support for Vortex86

Hardcode cache for family 5, use CPUID cache info for family 6.

* cpuinfo: Add support for Vortex86EX

The EX does not have brand string so hardcode name and cache.

* In determine_cache_size(), add an additional test to ensure that only
Vortex86 CPUs are handled, allowing Zhaoxin CPUs to fall through.
2023-05-20 20:10:05 +02:00
Sam Demeulemeester de4f4768fc Fix various temperature-related issues on older Atom CPUs
Also, remove the no_temperature var to keep only the enable_temperature flag
Older Atom still have the enable_temperature flag hard-coded to false until further tests are done
2023-05-18 16:03:48 +02:00
Kimon Hoffmann 0b251df68d
Enable using custom objcopy during build. (#291)
Signed-off-by: Kimon Hoffmann <Kimon.Hoffmann@lawo.com>
2023-05-17 17:37:10 +02:00
Sam Demeulemeester 9e3958714b
Add support for MMIO UART console (#300)
8/16/32-bit MMIO supported, with configuration options as kernel parameters.
2023-05-12 15:49:00 +02:00
Kimon Hoffmann acea409a51
Fix compiler used by "Build and tests" action (#292)
* Make sure the build workflow actually uses the chosen compiler.

Also clean up the repetitive nature of the workflow by defining the word
size as another matrix axis and making iso the default target.

Signed-off-by: Kimon Hoffmann <Kimon.Hoffmann@lawo.com>

* Disabled clang as a compiler alongside gcc.

The state of the current makefiles/source code is not compatible with
clang, so it makes no sense to try to build with it.

Signed-off-by: Kimon Hoffmann <Kimon.Hoffmann@lawo.com>
2023-05-12 15:46:52 +02:00
Sam Demeulemeester 7aeac7271f
Add Memory Controller Registers polling to get current DRAM Timings/Frequency (#306)
Read the memory controller configuration (instead of just relying on SPD data) to get the actual live settings.

Currently supported platforms:
* Intel SNB to RPL (Core 2nd Gen to Core 13th Gen) - Desktop only (no Server nor Mobile)
* AMD SMR to RPL (Zen to Zen4) - Desktop only (no Server, Mobile nor APU).


Individual commits below for archival:

* First functions skeleton for reading IMC/ECC Registers

* Change directory name from 'chipsets' to 'mch' (Memory Controller Hub)

* Add Intel HSW and fix new files encoding

* First Intel HSW IMC implementation

* Add an option to disable MCH registers polling

* Remove old include from Makefiles

* Better Makefile and padding fixes

* Statically init 'imc' struct to generate string relocation record

* Small typos & code fixes

* Add IMC support for Intel Core 6/7/8/9th Gen (SKL/KBL/CFL/CML) This is a bit more complex than Haswell and below because MMIO switched to 64-bit with Skylake (lot of) betatesting needed

* Add IMC read support for Intel SNB/IVB (2nd/3rd gen Core)

* Fix hard-lock on Intel SNB/IVB due to wrong access type on MCHBAR pointer

* Move AMD SMN Registers & offsets to a specific header file

* Add IMC Read support for AMD Zen/Zen2 CPUs

* Change 'IMC' to 'MCH' in Makefiles to match actual mch/ directory

* Add IMC Reading support for Intel ADL&RPL CPUs (Core Gen12&13)

* Add support for Intel Rocket Lake (Core 11th Gen) and AMD Vermeer

* Add IMC reading for AMD Zen4 'Raphael' AM5 CPUs

* Various Cleanup #1 
Change terminology from Intel-based 'MCH' (Memory Controller Hub) to more universal 'IMC' (Integrated Memory Controller) Integrate imc_type var into imc struct. Remove previously created AMD SNM header file

* Various Cleanup 2

* Change DDR5 display format for IMC specs
DDR5 Freq can be > 10000 and timings up to 63-127-127-127, which overwflow the available space.
This commit remove the raw frequency on DDR5 (which may be incorrect due to Gear mechanism) and leave a bit of space to display the Gear engaged in the future
2023-05-12 15:33:28 +02:00
Sam Demeulemeester 5dcd424ea7 Bump version to v6.20 2023-05-07 16:55:03 +02:00
Sam Demeulemeester 1f1fe5bfe8 Generalize the SMBus IO Enable quirk on all Intel ICHs
This has been tested safe on every ICH since the very first one by CPU-Z.
It also solves various SMBus access issues on Mobile PCHs (like #157)
2023-04-26 00:42:58 +02:00
Sam Demeulemeester 0fd2e4c37a Add support for Intel AlderLake-N CPUs 2023-04-24 00:29:37 +02:00
Sam Demeulemeester fa4e903509 Fix APIC Timer detection fail on some modern mobile/embedded PCH
On some modern ULV cores (eg: Gracemont), the 2 following I/O reads to check APIC Timer working status are fused in the frontend, leading to the same value being reported twice and the code falling back to the (unusually disabled on these platforms) PIT timer.

Whether this behavior is intentional or not is unknown.

As usleep/sleep is not available at this point, a dirty delay is added between the two reads.
2023-04-23 22:45:27 +02:00
dependabot[bot] bfbb167a72
Bump actions/stale from 7 to 8 (#287)
Bumps [actions/stale](https://github.com/actions/stale) from 7 to 8.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v7...v8)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-29 18:34:20 +02:00
Sam Demeulemeester 79bb781431 Better handling of big FAIL banned in case of errors 2023-03-29 18:29:59 +02:00
Sam Demeulemeester c6b04e5414 Display big banner only once 2023-03-29 17:58:12 +02:00
Sam Demeulemeester 5cbcd2046b Add 'Jade Star' & 'InnoDisk' JEDEC Manufacturers 2023-03-09 23:08:01 +01:00
Sam Demeulemeester bf0dae04bc Remove deprecated ubuntu-18.04 job 2023-03-07 00:34:31 +01:00
Jonathan Teh dcca756e48
[cpuinfo] Fix old CPUs (P5/P6-class) name and cache info (#267)
* cpuinfo: Fix WinChip and Cyrix/NSC CPU name and cache info

Always populate the cache info from extended CPUID, it is not used for
Intel CPUs, even though it is present, and is useful for non-Intel CPUs.

Fix the CPU name and cache sizes for Centaur and Cyrix/NSC CPUs without
brand string, which are the WinChip C6 and all Cyrix CPUs except the
Media GXm.

For the Media GXm and Geode GXm/GXLV/GX1, which are available with both
Cyrix and NSC vendor strings, hardcode the L1 cache size. The Geode GX2
uses standard cache info.

* Add 'Intel' in CPU names for older CPUs

* Add 'Transmeta' and 'IDT' in CPU names for older CPUs
-------

Co-authored-by: Sam Demeulemeester <github@x86-secret.com>
2023-03-03 13:21:27 +01:00
Sam Demeulemeester 262aac4f85
[SMBUS] Add support for ALi M1533/1535/1543C (#273)
Closes #126
2023-02-20 18:31:33 +01:00
Sam Demeulemeester 66bd82f12a
[SMBus] Add support for ALi M1563 Southbridge (#272) 2023-02-19 17:29:56 +01:00
Sam Demeulemeester ee0c400821 [SMBUS] Add support for VIA VT8233 Southbridge 2023-02-18 19:01:59 +01:00
Sam Demeulemeester e1fc02bfe0 [SMBUS] Add support for VIA VT8233A Southbridge 2023-02-18 18:58:34 +01:00
Sam Demeulemeester a1d046fc3a Fix a typo in README.md (serial console baud rate) 2023-02-18 18:51:02 +01:00
Sam Demeulemeester 1a38f513de
[Temperature] Add support for CPUs with specific TjMax (#269)
Solve an issue where reading MSR_IA32_TEMPERATURE_TARGET makes the system crash (e.g. Early Mobile Yonah)
2023-02-18 18:43:38 +01:00
Sam Demeulemeester 22663f89bb
Add support for AMD K8 temperature reporting. (#268)
Add various quirks to handle AMD temp sensors erratas
2023-02-13 22:29:17 +01:00
Sam Demeulemeester c38b0cbc5f [SMBUS] Add support for nVidia nForce 3 2023-02-13 19:43:09 +01:00
Sam Demeulemeester dfc41f7196 Solve incorrect core/thread count on some VIA CPUs
No Cyrix / VIA / CentaurHauls / Zhaoxin CPUs support HT, so disable it.
2023-02-11 19:00:36 +01:00
Martin Whitaker f62bbfde32 Additional fix to support use on headless EFI systems (issue #240) 2023-02-11 09:14:56 +00:00
Jonathan Teh 8305d47675
Support cache and temperature info for VIA/Centaur/Zhaoxin CPUs (#259)
* Support cache and temperature info for VIA/Centaur/Zhaoxin CPUs

Use extended CPUID for VIA C3/C7/Nano cache information.

Use MSR reads for Nano/Zhaoxin and VIA C7 processor temperature.

Tested on VIA C7-D 1.5GHz.

* Small code conventions fixes

* Fix overallocation of cpuid_cache_info_t union (From PR #263)

---------

Co-authored-by: Sam Demeulemeester <github@x86-secret.com>
2023-02-10 22:32:31 +01:00
Jonathan Teh a47f681151 smbus: Add support for VIA VT8237
Tested on Jetway J7F2 with VT8237R+.

Signed-off-by: Jonathan Teh <jonathan.teh@outlook.com>
2023-02-05 08:22:13 +01:00
Martin Whitaker 68e9542c1e Restore ability to build 64-bit binaries when building on 32-bit system. 2023-02-04 10:10:05 +00:00
Sam Demeulemeester ce2c29eddc Bump version to v6.10 2023-02-02 23:52:18 +01:00
Martin Whitaker b01c8e4388 Avoid sbverify warning about gap in section table.
We have a .setup section in the EFI image that contains the remainder of
the Linux boot header and the real-mode setup code to support booting via
an intermediate bootloader. This sits between the PE header and the .text
section. We don't want the EFI loader to load this section, so simply
increase the SizeOfHeader field in the PE header to cover it.
2023-02-02 14:01:13 +01:00
Martin Whitaker d088740757 Fix the bss section size in 32-bit builds.
The AP stacks section was being discarded by the linker because the
change in section name and attributes hadn't been propagated from
the startup64.S to startup32.S.
2023-02-02 14:01:13 +01:00
Martin Whitaker 9c16a0568a Fix assembler warning about incorrect type/attributes for .reloc section. 2023-02-02 14:01:13 +01:00
Martin Whitaker 040e253b54 Remove the alignment characteristics from the EFI image PE section table.
The alignment characteristics are only valid in COFF files. The section
alignment for image files is determined by the SectionAlignment field
in the image header.
2023-02-02 14:01:13 +01:00
Martin Whitaker 2fa2346ae0 Use the correct name for the relocation type in the EFI image .reloc section.
The coding is the same, but IMAGE_REL_AMD64_ABSOLUTE is used for COFF
relocations, not for base relocations.
2023-02-02 14:01:13 +01:00
Martin Whitaker e5d7119abf White space changes to improve readability. 2023-02-02 14:01:13 +01:00
Martin Whitaker a4c9adc445 Fix the virtual memory addresses and sizes in the EFI image headers.
When the reloc and sbat sections were added by PR #34, three bugs were
introduced:

1. The virtual address and size fields in the PE headers were set to the
same values as the raw address and size fields. This is incorrect, because
the sections in the image file are aligned on 512 byte boundaries, but when
loaded into memory they need to be aligned on 4096 byte boundaries.

2. The value programmed into the SizeOfImage field was too large, as it
double-counted the region before the start of the .text section.

3. The value programmed into the SizeOfImage field no longer included the bss
size. That potentially allowed the EFI loader to load the image immediately
before a reserved region of memory without leaving enough space for the bss
section.

This commit fixes those bugs by calculating both file and virtual memory
offsets & sizes in the ld script. Note that we can't add a bss section to the
EFI image because many EFI loaders fail to load images that have uninitialised
data sections. Instead the text region size in virtual memory is increased
to include the bss size.

This fixes issue #243. It also eliminates the gaps between sections
observed in issue #202.
2023-02-02 14:01:13 +01:00
Sam Demeulemeester 485bfa46a3
Add a quirk to disable SMP on SuperMicro X10SDV (#244) 2023-01-30 16:47:54 +01:00
Sam Demeulemeester b15a8bb632 Add SPD support for ATI SB400 Southbridge 2023-01-23 16:09:32 +01:00
martinwhitaker 327495ec61
Allow use on headless EFI systems. (#242)
A headless EFI system may have no GOP devices. In this case, disable
output to the physical display, but continue to write to the shadow
buffer. This allows operation via a serial console.
2023-01-23 15:50:52 +01:00
Lionel Debroux 8f788b27e1 Add support for configuring the error reporting mode through the command line. Fixes #83. 2023-01-23 15:49:45 +01:00
Lionel Debroux f24e897883 Add support for configuring the CPU sequencing mode through the command line. Reorder tests in app/config.c::parse_option alphabetically. Fixes #82. 2023-01-23 15:49:45 +01:00
Lionel Debroux 3aeda70e24 Move more of the simple string functions to the header, to allow inlining and further optimization.
Before:
   text    data     bss     dec     hex filename
  10374      19    2712   13105    3331 app/config.o
 106854   26720   13344  146918   23de6 memtest_shared
   8734      19    2712   11465    2cc9 app/config.o
 111310   28392  294688  434390   6a0d6 memtest_shared

After:
   text    data     bss     dec     hex filename
  10105      19    2712   12836    3224 app/config.o
 106580   26720   13344  146644   23cd4 memtest_shared
   8653      19    2712   11384    2c78 app/config.o
 110969   28392  294688  434049   69f81 memtest_shared
2023-01-23 15:49:45 +01:00
Lionel Debroux b6992b9ec0
Fix parallel build after d3d52b: boot/setup.S now contains #include "build_version.h", so that file needs to be generated beforehand. (#235) 2023-01-23 15:17:47 +01:00
Sam Demeulemeester 10e8435604 Add SPD support for legacy VIA Southbridges (VT82C686A/B & VT8235)
(From PR #236)

Author: Corentin Labbe clabbe.montjoie@gmail.com
Co-developed-by: Lionel Debroux lionel_debroux@yahoo.fr
2023-01-23 15:01:48 +01:00
martinwhitaker 186ef6e913
Improved own addr test (#219)
* For 64-bit images, use the physical address as the test pattern in test 2.

This will make it easier to diagnose faults.

* Disable test 1 by default (issue #155).

Test 2 provides the same test coverage. Test 1 may make it slightly easier
to diagnose faults with a 32-bit image, so leave it as an option.

* For 32 bit images, use the physical address to generate the offset in test 2.

Detecting a stage change and using that to reset the offset counter
could fail when the config menu was used to skip to the next test
(issue #224).
2023-01-04 23:26:22 +01:00
martinwhitaker d0399fd287
Add a command line option to disable the big PASS/FAIL status display. (#227) 2023-01-04 16:16:55 +01:00
Anders Wenhaug 68deff493f
Change how BadRAM patterns are aggregated to minimize the number of covered addresses (#178)
* BadRAM: Rename pattern -> patterns

* BadRAM: Refactor COMBINE_MASK and add clarifying comment

* BadRAM: Extract DEFAULT_MASK into variable

* BadRAM: Add is_covered() for checking if pattern is already covered by one of the existing patterns

* BadRAM: Initialize patterns to 0

* BadRAM: Change how addr/masks are merged to minimize number of addresses covered by badram

Prior to this patch, a list of up to MAX_PATTERNS (=10) addr/mask tuples
(aka. pattern) were maintained, adding failing addresses one by one to
the list until it was full. When full, space was created by forcing a
merge of the new address with the existing pattern that would grow the
least (with regards to number of addresses covered by the pattern) by
merging it with the new address. This can lead to a great imbalance in
the number of addresses covered by the patterns. Consider the following:

MAX_PATTERNS=4 (for illustrative purposes).
The following addresses are faulted and added to patterns:
0x00, 0x10, 0x20, 0x68, 0xa0, 0xb0, 0xc0, 0xd0

This is the end result with the implementation prior to this commit:

patterns = [
  (0x00, 0xe8),
  (0x00, 0x18),
  (0x68, 0xf8),
  (0x90, 0x98)
]
Total addresses covered: 120.

This commit changes how the merges are done, not only considering a
merge between the new address and existing patterns, but also between
existing patterns. It keeps the patterns in ascending order (by .addr)
in patterns, and a new address is always inserted into patterns (even if
num_patterns == MAX_PATTERNS, patterns is of MAX_PATTERNS+1 size). Then,
if num_patterns > MAX_PATTERNS, we find the pair of patterns (only
considering neighbours, assuming for any pattern i, i-1 or i+1 will
be the best candidate for a merge) that would be the cheapest to
merge (using the same metric as prior to this patch), and merge those.

With this commit, this is the result of the exact same sequence of
addresses as above:
[
  (0x00, 0xe0),
  (0x68, 0xf8),
  (0xa0, 0xe8),
  (0xc0, 0xe8)
]
Total addresses covered: 72.

A drawback of the current implementation (as compared to the prior)
is that it does not make any attempt at merging patterns until
num_patterns == MAX_PATTERNS, which can lead to having several patterns
that could've been merged into one at no additional cost. I.e.:

patterns = [
  (0x00, 0xf8),
  (0x08, 0xf8)
]
can appear, even if
patterns = [
  (0x00, 0xf0)
]
represents the exact same addresses with one pattern instead of two.

* fixup! BadRAM: Change how addr/masks are merged to minimize number of addresses covered by badram

Co-authored-by: Anders Wenhaug <anders.wenhaug@solutionseeker.no>
2023-01-03 23:12:47 +01:00