diff options
| author | Tom Rini <[email protected]> | 2023-08-01 11:57:55 -0400 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2023-08-01 11:57:55 -0400 |
| commit | 7755b2200777f72dca87dd169138e95f011bbcb9 (patch) | |
| tree | c8efbd18be71924f85faec5272bd779da89828ed /arch | |
| parent | e5b082a3c594cc332ccb5db0296bad7a4c070bf0 (diff) | |
| parent | db971a7587d04b3f1cf2e6d452f9e37f50c5b3ed (diff) | |
Merge tag 'x86-pull-20230801' of https://source.denx.de/u-boot/custodians/u-boot-x86
- MTRR fixes for x86 boards
- Add a little more info to 'cbsysinfo' command
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/x86/cpu/mtrr.c | 6 | ||||
| -rw-r--r-- | arch/x86/include/asm/cb_sysinfo.h | 4 | ||||
| -rw-r--r-- | arch/x86/lib/coreboot/cb_sysinfo.c | 4 | ||||
| -rw-r--r-- | arch/x86/lib/fsp/fsp_graphics.c | 3 | ||||
| -rw-r--r-- | arch/x86/lib/init_helpers.c | 6 |
5 files changed, 16 insertions, 7 deletions
diff --git a/arch/x86/cpu/mtrr.c b/arch/x86/cpu/mtrr.c index d57fcface01..9c24ae984e9 100644 --- a/arch/x86/cpu/mtrr.c +++ b/arch/x86/cpu/mtrr.c @@ -166,8 +166,12 @@ int mtrr_commit(bool do_caches) debug("open done\n"); qsort(req, gd->arch.mtrr_req_count, sizeof(*req), h_comp_mtrr); for (i = 0; i < gd->arch.mtrr_req_count; i++, req++) - mtrr_set_next_var(req->type, req->start, req->size); + set_var_mtrr(i, req->type, req->start, req->size); + /* Clear the ones that are unused */ + debug("clear\n"); + for (; i < mtrr_get_var_count(); i++) + wrmsrl(MTRR_PHYS_MASK_MSR(i), 0); debug("close\n"); mtrr_close(&state, do_caches); debug("mtrr done\n"); diff --git a/arch/x86/include/asm/cb_sysinfo.h b/arch/x86/include/asm/cb_sysinfo.h index 2c78b22d0d2..12fa395ffd2 100644 --- a/arch/x86/include/asm/cb_sysinfo.h +++ b/arch/x86/include/asm/cb_sysinfo.h @@ -138,6 +138,8 @@ * @rsdp: Pointer to ACPI RSDP table * @unimpl_count: Number of entries in unimpl_map[] * @unimpl: List of unimplemented IDs (bottom 8 bits only) + * @table_size: Number of bytes taken up by the sysinfo table + * @rec_count: Number of records in the sysinfo table */ struct sysinfo_t { unsigned int cpu_khz; @@ -219,6 +221,8 @@ struct sysinfo_t { void *rsdp; u32 unimpl_count; u8 unimpl[SYSINFO_MAX_UNIMPL]; + uint table_size; + uint rec_count; }; extern struct sysinfo_t lib_sysinfo; diff --git a/arch/x86/lib/coreboot/cb_sysinfo.c b/arch/x86/lib/coreboot/cb_sysinfo.c index 42cc3a128d9..dfbc80c430e 100644 --- a/arch/x86/lib/coreboot/cb_sysinfo.c +++ b/arch/x86/lib/coreboot/cb_sysinfo.c @@ -447,6 +447,8 @@ static int cb_parse_header(void *addr, int len, struct sysinfo_t *info) ptr += rec->size; } + info->table_size += (void *)ptr - (void *)header; + info->rec_count += header->table_entries; return 1; } @@ -462,6 +464,8 @@ int get_coreboot_info(struct sysinfo_t *info) addr = locate_coreboot_table(); if (addr < 0) return addr; + info->table_size = 0; + info->rec_count = 0; ret = cb_parse_header((void *)addr, 0x1000, info); if (!ret) return -ENOENT; diff --git a/arch/x86/lib/fsp/fsp_graphics.c b/arch/x86/lib/fsp/fsp_graphics.c index 2bcc49f6051..09d5da8c841 100644 --- a/arch/x86/lib/fsp/fsp_graphics.c +++ b/arch/x86/lib/fsp/fsp_graphics.c @@ -110,8 +110,7 @@ static int fsp_video_probe(struct udevice *dev) if (ret) goto err; - mtrr_add_request(MTRR_TYPE_WRCOMB, vesa->phys_base_ptr, 256 << 20); - mtrr_commit(true); + mtrr_set_next_var(MTRR_TYPE_WRCOMB, vesa->phys_base_ptr, 256 << 20); printf("%dx%dx%d @ %x\n", uc_priv->xsize, uc_priv->ysize, vesa->bits_per_pixel, vesa->phys_base_ptr); diff --git a/arch/x86/lib/init_helpers.c b/arch/x86/lib/init_helpers.c index f33194045f9..60a2707dcf1 100644 --- a/arch/x86/lib/init_helpers.c +++ b/arch/x86/lib/init_helpers.c @@ -21,8 +21,7 @@ int init_cache_f_r(void) /* * Supported configurations: * - * booting from slimbootloader - in that case the MTRRs are already set - * up + * booting from slimbootloader - MTRRs are already set up * booting with FSPv1 - MTRRs are already set up * booting with FSPv2 - MTRRs must be set here * booting from coreboot - in this case there is no SPL, so we set up @@ -30,8 +29,7 @@ int init_cache_f_r(void) * Note: if there is an SPL, then it has already set up MTRRs so we * don't need to do that here */ - do_mtrr &= !IS_ENABLED(CONFIG_SPL) && - !IS_ENABLED(CONFIG_FSP_VERSION1) && + do_mtrr &= !IS_ENABLED(CONFIG_FSP_VERSION1) && !IS_ENABLED(CONFIG_SYS_SLIMBOOTLOADER); if (do_mtrr) { |
