Skip to content
Snippets Groups Projects
  1. Aug 01, 2023
    • Simon Glass's avatar
      x86: Add a little more info to cbsysinfo · db971a75
      Simon Glass authored and Bin Meng's avatar Bin Meng committed
      
      Show the number of records in the table and the total table size in
      bytes.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      Reviewed-by: Bin Meng's avatarBin Meng <bmeng.cn@gmail.com>
    • Simon Glass's avatar
      x86: Return mtrr_add_request() to its old purpose · d560f7ca
      Simon Glass authored and Bin Meng's avatar Bin Meng committed
      
      This function used to be for adding a list of requests to be actioned on
      relocation. Revert it back to this purpose, to avoid problems with boards
      which need control of their MTRRs (i.e. those which don't use FSP).
      
      The mtrr_set_next_var() function is available when the next free
      variable-MTRR must be set, so this can be used instead.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      Reviewed-by: Bin Meng's avatarBin Meng <bmeng.cn@gmail.com>
      Fixes: 3bcd6cf8 ("x86: mtrr: Skip MSRs that were already programmed..")
      Fixes: 596bd058 ("x86: mtrr: Do not clear the unused ones..")
      Signed-off-by: Bin Meng's avatarBin Meng <bmeng.cn@gmail.com>
      d560f7ca
    • Bin Meng's avatar
      video: vesa: Use mtrr_set_next_var() for graphics memory · bff002d4
      Bin Meng authored
      
      At present this uses mtrr_add_request() & mtrr_commit() combination
      to program the MTRR for graphics memory. This usage has two major
      issues as below:
      
      - mtrr_commit() will re-initialize all MTRR registers from index 0,
        using the settings previously added by mtrr_add_request() and saved
        in gd->arch.mtrr_req[], which won't cause any issue but is unnecessary
      - The way such combination works is based on the assumption that U-Boot
        has full control with MTRR programming (e.g.: U-Boot without any blob
        that does all low-level initialization on its own, or using FSP2 which
        does not touch MTRR), but this is not the case with FSP. FSP programs
        some MTRRs during its execution but U-Boot does not have the settings
        saved in gd->arch.mtrr_req[] and when doing mtrr_commit() it will
        corrupt what was already programmed previously.
      
      Correct this to use mtrr_set_next_var() instead.
      
      Signed-off-by: Bin Meng's avatarBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      bff002d4
    • Bin Meng's avatar
      video: ivybridge: Use mtrr_set_next_var() for graphics memory · 0f497b2b
      Bin Meng authored
      
      At present this uses mtrr_add_request() & mtrr_commit() combination
      to program the MTRR for graphics memory. This usage has two major
      issues as below:
      
      - mtrr_commit() will re-initialize all MTRR registers from index 0,
        using the settings previously added by mtrr_add_request() and saved
        in gd->arch.mtrr_req[], which won't cause any issue but is unnecessary
      - The way such combination works is based on the assumption that U-Boot
        has full control with MTRR programming (e.g.: U-Boot without any blob
        that does all low-level initialization on its own, or using FSP2 which
        does not touch MTRR), but this is not the case with FSP. FSP programs
        some MTRRs during its execution but U-Boot does not have the settings
        saved in gd->arch.mtrr_req[] and when doing mtrr_commit() it will
        corrupt what was already programmed previously.
      
      Correct this to use mtrr_set_next_var() instead.
      
      Signed-off-by: Bin Meng's avatarBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      0f497b2b
    • Bin Meng's avatar
      video: broadwell: Use mtrr_set_next_var() for graphics memory · b5126f26
      Bin Meng authored
      
      At present this uses mtrr_add_request() & mtrr_commit() combination
      to program the MTRR for graphics memory. This usage has two major
      issues as below:
      
      - mtrr_commit() will re-initialize all MTRR registers from index 0,
        using the settings previously added by mtrr_add_request() and saved
        in gd->arch.mtrr_req[], which won't cause any issue but is unnecessary
      - The way such combination works is based on the assumption that U-Boot
        has full control with MTRR programming (e.g.: U-Boot without any blob
        that does all low-level initialization on its own, or using FSP2 which
        does not touch MTRR), but this is not the case with FSP. FSP programs
        some MTRRs during its execution but U-Boot does not have the settings
        saved in gd->arch.mtrr_req[] and when doing mtrr_commit() it will
        corrupt what was already programmed previously.
      
      Correct this to use mtrr_set_next_var() instead.
      
      Signed-off-by: Bin Meng's avatarBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      b5126f26
    • Bin Meng's avatar
      x86: fsp: Use mtrr_set_next_var() for graphics memory · 3dfa4115
      Bin Meng authored
      
      At present this uses mtrr_add_request() & mtrr_commit() combination
      to program the MTRR for graphics memory. This usage has two major
      issues as below:
      
      - mtrr_commit() will re-initialize all MTRR registers from index 0,
        using the settings previously added by mtrr_add_request() and saved
        in gd->arch.mtrr_req[], which won't cause any issue but is unnecessary
      - The way such combination works is based on the assumption that U-Boot
        has full control with MTRR programming (e.g.: U-Boot without any blob
        that does all low-level initialization on its own, or using FSP2 which
        does not touch MTRR), but this is not the case with FSP. FSP programs
        some MTRRs during its execution but U-Boot does not have the settings
        saved in gd->arch.mtrr_req[] and when doing mtrr_commit() it will
        corrupt what was already programmed previously.
      
      Correct this to use mtrr_set_next_var() instead.
      
      Signed-off-by: Bin Meng's avatarBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      3dfa4115
    • Bin Meng's avatar
      x86: Change testing logic of mtrr commit · 41fbb344
      Bin Meng authored
      
      On Coral U-Boot SPL programs some MTRRs and FSPv2 in U-Boot proper
      needs to program MTRRs too. With current testing logic of mtrr
      commit in init_cache_f_r(), the mtrr commit is skipped which won't
      work as the queued mtrr requests include setup for DRAM regions.
      
      Change the logic to allow such configuration.
      
      Signed-off-by: Bin Meng's avatarBin Meng <bmeng.cn@gmail.com>
      Tweak to put back CONFIG_FSP_VERSION2 at top:
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      41fbb344
  2. Jul 31, 2023
Loading