All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 045/108] x86: Add a new global_data member for the cache record
Date: Sun, 20 Oct 2019 21:38:10 -0600	[thread overview]
Message-ID: <20191021033913.220758-45-sjg@chromium.org> (raw)
In-Reply-To: <20191021033913.220758-22-sjg@chromium.org>

At present we reuse the mrc_output char * to also point to the cache
record after it has been set up. This is confusing and doesn't save much
data space.

Add a new mrc_cache member instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
---

Changes in v3: None
Changes in v2: None

 arch/x86/include/asm/global_data.h |  2 ++
 arch/x86/lib/mrccache.c            | 11 +++++------
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/arch/x86/include/asm/global_data.h b/arch/x86/include/asm/global_data.h
index 7f3ada06f61..67d9a38177e 100644
--- a/arch/x86/include/asm/global_data.h
+++ b/arch/x86/include/asm/global_data.h
@@ -10,6 +10,7 @@
 #ifndef __ASSEMBLY__
 
 #include <asm/processor.h>
+#include <asm/mrccache.h>
 
 enum pei_boot_mode_t {
 	PEI_BOOT_NONE = 0,
@@ -93,6 +94,7 @@ struct arch_global_data {
 	/* MRC training data to save for the next boot */
 	char *mrc_output;
 	unsigned int mrc_output_len;
+	struct mrc_data_container *mrc_cache;
 	ulong table;			/* Table pointer from previous loader */
 	int turbo_state;		/* Current turbo state */
 	struct irq_routing_table *pirq_routing_table;
diff --git a/arch/x86/lib/mrccache.c b/arch/x86/lib/mrccache.c
index b5d1ea11c5b..d1334a4542d 100644
--- a/arch/x86/lib/mrccache.c
+++ b/arch/x86/lib/mrccache.c
@@ -183,8 +183,7 @@ static void mrccache_setup(void *data)
 	cache->reserved = 0;
 	memcpy(cache->data, gd->arch.mrc_output, cache->data_size);
 
-	/* gd->arch.mrc_output now points to the container */
-	gd->arch.mrc_output = (char *)cache;
+	gd->arch.mrc_cache = cache;
 }
 
 int mrccache_reserve(void)
@@ -250,7 +249,7 @@ int mrccache_get_region(struct udevice **devp, struct mrc_region *entry)
 
 int mrccache_save(void)
 {
-	struct mrc_data_container *data;
+	struct mrc_data_container *cache;
 	struct mrc_region entry;
 	struct udevice *sf;
 	int ret;
@@ -266,10 +265,10 @@ int mrccache_save(void)
 	ret = device_probe(sf);
 	if (ret)
 		goto err_entry;
-	data  = (struct mrc_data_container *)gd->arch.mrc_output;
-	ret = mrccache_update(sf, &entry, data);
+	cache = gd->arch.mrc_cache;
+	ret = mrccache_update(sf, &entry, cache);
 	if (!ret) {
-		debug("Saved MRC data with checksum %04x\n", data->checksum);
+		debug("Saved MRC data with checksum %04x\n", cache->checksum);
 	} else if (ret == -EEXIST) {
 		debug("MRC data is the same as last time, skipping save\n");
 		ret = 0;
-- 
2.23.0.866.gb869b98d4c-goog

  parent reply	other threads:[~2019-10-21  3:38 UTC|newest]

Thread overview: 201+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-21  3:37 [U-Boot] [PATCH v3 022/108] x86: timer: Use a separate flag for whether timer is inited Simon Glass
2019-10-21  3:37 ` [U-Boot] [PATCH v3 023/108] x86: timer: Allow a timer base of 0 Simon Glass
2019-10-28 13:02   ` Bin Meng
2019-10-21  3:37 ` [U-Boot] [PATCH v3 024/108] x86: spl: Support init of a PUNIT Simon Glass
2019-10-28  7:12   ` Bin Meng
2019-11-02  9:49     ` Bin Meng
2019-10-21  3:37 ` [U-Boot] [PATCH v3 025/108] x86: tpl: Add a fake PCI bus Simon Glass
2019-10-21  7:52   ` Andy Shevchenko
2019-10-21 22:53     ` Simon Glass
2019-10-22  8:19       ` Andy Shevchenko
2019-10-22 13:50         ` Simon Glass
2019-10-28  7:12   ` Bin Meng
2019-11-02  9:49     ` Bin Meng
2019-10-21  3:37 ` [U-Boot] [PATCH v3 026/108] x86: timer: Reduce timer code size in TPL on Intel CPUs Simon Glass
2019-10-28  7:26   ` Bin Meng
2019-11-02 18:25     ` Simon Glass
2019-10-21  3:37 ` [U-Boot] [PATCH v3 027/108] x86: Drop unnecessary cpu code for TPL Simon Glass
2019-10-28 12:56   ` Bin Meng
2019-10-21  3:37 ` [U-Boot] [PATCH v3 028/108] x86: Drop unnecessary interrupt " Simon Glass
2019-10-28  7:49   ` Bin Meng
2019-10-21  3:37 ` [U-Boot] [PATCH v3 029/108] x86: Add a CPU init function " Simon Glass
2019-10-28  7:50   ` Bin Meng
2019-11-02  9:58     ` Bin Meng
2019-10-21  3:37 ` [U-Boot] [PATCH v3 030/108] x86: Move CPU init to before spl_init() Simon Glass
2019-10-28  7:52   ` Bin Meng
2019-11-02  9:58     ` Bin Meng
2019-10-21  3:37 ` [U-Boot] [PATCH v3 031/108] x86: Don't print CPU info in TPL Simon Glass
2019-11-02  5:52   ` Bin Meng
2019-11-02  9:58     ` Bin Meng
2019-10-21  3:37 ` [U-Boot] [PATCH v3 032/108] x86: Quieten TPL's jump_to_image_no_args() Simon Glass
2019-11-02  5:52   ` Bin Meng
2019-11-02  9:58     ` Bin Meng
2019-10-21  3:37 ` [U-Boot] [PATCH v3 033/108] x86: power: Add an ACPI PMC uclass Simon Glass
2019-11-02  5:52   ` Bin Meng
2019-11-04  8:02   ` Bin Meng
2019-11-21 13:50     ` Simon Glass
2019-10-21  3:37 ` [U-Boot] [PATCH v3 034/108] x86: sandbox: Add a PMC emulator and test Simon Glass
2019-10-21  3:38 ` [U-Boot] [PATCH v3 035/108] x86: power: Add a 'pmc' command Simon Glass
2019-10-21  7:48   ` Andy Shevchenko
2019-10-21 22:53     ` Simon Glass
2019-10-22  8:21       ` Andy Shevchenko
2019-10-22 13:50         ` Simon Glass
2019-10-21  3:38 ` [U-Boot] [PATCH v3 036/108] pci: Add support for p2sb uclass Simon Glass
2019-11-04  8:23   ` Bin Meng
2019-11-21 13:50     ` Simon Glass
2019-10-21  3:38 ` [U-Boot] [PATCH v3 037/108] sandbox: Add PCI driver and test for p2sb Simon Glass
2019-11-04  8:36   ` Bin Meng
2019-10-21  3:38 ` [U-Boot] [PATCH v3 038/108] x86: Move UCLASS_IRQ into a separate file Simon Glass
2019-11-04  8:41   ` Bin Meng
2019-10-21  3:38 ` [U-Boot] [PATCH v3 039/108] sandbox: Add a test for IRQ Simon Glass
2019-11-04  8:45   ` Bin Meng
2019-10-21  3:38 ` [U-Boot] [PATCH v3 040/108] x86: Define the SPL image start Simon Glass
2019-11-04  8:46   ` Bin Meng
2019-10-21  3:38 ` [U-Boot] [PATCH v3 041/108] x86: Reduce mrccache record alignment size Simon Glass
2019-11-04  8:50   ` Bin Meng
2019-10-21  3:38 ` [U-Boot] [PATCH v3 042/108] x86: Correct mrccache find_next_mrc_cache() calculation Simon Glass
2019-11-04 15:01   ` Bin Meng
2019-10-21  3:38 ` [U-Boot] [PATCH v3 043/108] x86: Adjust mrccache_get_region() to use livetree Simon Glass
2019-11-04 15:06   ` Bin Meng
2019-11-12  0:51     ` Simon Glass
2019-11-13 15:16       ` Bin Meng
2019-10-21  3:38 ` [U-Boot] [PATCH v3 044/108] x86: Adjust mrccache_get_region() to support get_mmap() Simon Glass
2019-10-21  3:38 ` Simon Glass [this message]
2019-10-21  3:38 ` [U-Boot] [PATCH v3 046/108] x86: Tidy up error handling in mrccache_save() Simon Glass
2019-10-21  3:38 ` [U-Boot] [PATCH v3 047/108] x86: Update mrccache to support multiple caches Simon Glass
2019-11-04 15:22   ` Bin Meng
2019-10-21  3:38 ` [U-Boot] [PATCH v3 048/108] x86: Add mrccache support for a 'variable' cache Simon Glass
2019-11-04 15:23   ` Bin Meng
2019-10-21  3:38 ` [U-Boot] [PATCH v3 049/108] x86: Move fsp_prepare_mrc_cache() to fsp1 directory Simon Glass
2019-10-21  3:38 ` [U-Boot] [PATCH v3 050/108] x86: Set the DRAM banks to reflect real location Simon Glass
2019-11-04 15:24   ` Bin Meng
2019-10-21  3:38 ` [U-Boot] [PATCH v3 051/108] x86: Set up the MTRR for SDRAM Simon Glass
2019-11-19  2:23   ` Bin Meng
2019-10-21  3:38 ` [U-Boot] [PATCH v3 052/108] x86: Don't imply libfdt or SPI flash in TPL Simon Glass
2019-11-19  2:23   ` Bin Meng
2019-10-21  3:38 ` [U-Boot] [PATCH v3 053/108] x86: Allow removal of standard PCH drivers Simon Glass
2019-10-21  3:38 ` [U-Boot] [PATCH v3 054/108] x86: Allow interrupt to happen once Simon Glass
2019-10-21  3:38 ` [U-Boot] [PATCH v3 055/108] x86: fsp: Make graphics support common to FSP1/2 Simon Glass
2019-11-19  2:23   ` Bin Meng
2019-10-21  3:38 ` [U-Boot] [PATCH v3 056/108] x86: fsp: Correct wrong header inlude in fsp_support.c Simon Glass
2019-11-19  7:25   ` Bin Meng
2019-10-21  3:38 ` [U-Boot] [PATCH v3 057/108] x86: fsp: Add FSP2 base support Simon Glass
2019-11-19  7:25   ` Bin Meng
2019-11-21 13:50     ` Simon Glass
2019-10-21  3:38 ` [U-Boot] [PATCH v3 058/108] x86: fsp: Set up an MTRR for the graphics frame buffer Simon Glass
2019-11-19  7:25   ` Bin Meng
2019-10-21  3:38 ` [U-Boot] [PATCH v3 059/108] x86: fsp: Add a new arch_fsp_init_r() hook Simon Glass
2019-11-19  7:25   ` Bin Meng
2019-10-21  3:38 ` [U-Boot] [PATCH v3 060/108] x86: fsp: Allow remembering the location of FSP-S Simon Glass
2019-11-19  7:25   ` Bin Meng
2019-10-21  3:38 ` [U-Boot] [PATCH v3 061/108] x86: fsp: Make the notify API call common Simon Glass
2019-11-19  8:02   ` Bin Meng
2019-10-21  3:38 ` [U-Boot] [PATCH v3 062/108] x86: Don't include the BIOS emulator in TPL Simon Glass
2019-10-21  3:38 ` [U-Boot] [PATCH v3 063/108] x86: Add an option to include a FIT Simon Glass
2019-11-19  8:02   ` Bin Meng
2019-10-21  3:38 ` [U-Boot] [PATCH v3 064/108] x86: Add support for newer CAR schemes Simon Glass
2019-10-21  8:11   ` Andy Shevchenko
2019-11-19  8:02   ` Bin Meng
2019-10-21  3:38 ` [U-Boot] [PATCH v3 065/108] x86: Disable microcode section for FSP2 Simon Glass
2019-11-19  8:02   ` Bin Meng
2019-10-21  3:38 ` [U-Boot] [PATCH v3 066/108] x86: Update the fsp command " Simon Glass
2019-11-19  8:34   ` Bin Meng
2019-10-21  3:38 ` [U-Boot] [PATCH v3 067/108] x86: Update .dtsi file " Simon Glass
2019-11-19  8:34   ` Bin Meng
2019-10-21  3:38 ` [U-Boot] [PATCH v3 068/108] x86: Add an option to control the position of U-Boot Simon Glass
2019-11-19  8:34   ` Bin Meng
2019-11-21 13:50     ` Simon Glass
2019-10-21  3:38 ` [U-Boot] [PATCH v3 069/108] x86: Add an option to control the position of SPL Simon Glass
2019-11-19  8:34   ` Bin Meng
2019-10-21  3:38 ` [U-Boot] [PATCH v3 070/108] x86: Add an fdtmap and image-header Simon Glass
2019-11-19  8:34   ` Bin Meng
2019-10-21  3:38 ` [U-Boot] [PATCH v3 071/108] x86: Don't repeat microcode in U-Boot if not needed Simon Glass
2019-11-19 13:33   ` Bin Meng
2019-10-21  3:38 ` [U-Boot] [PATCH v3 072/108] x86: Separate out U-Boot and device tree in ROM image Simon Glass
2019-11-19 13:33   ` Bin Meng
2019-10-21  3:38 ` [U-Boot] [PATCH v3 073/108] x86: Make MSR_PKG_POWER_SKU common Simon Glass
2019-11-19 13:33   ` Bin Meng
2019-10-21  3:38 ` [U-Boot] [PATCH v3 074/108] spi: Correct operations check in dm_spi_xfer() Simon Glass
2019-11-19 13:33   ` Bin Meng
2019-10-21  3:38 ` [U-Boot] [PATCH v3 075/108] x86: spi: Don't enable SPI_FLASH_BAR by default Simon Glass
2019-11-19 13:33   ` Bin Meng
2019-11-20  5:22     ` Vignesh Raghavendra
2019-11-21 13:50       ` Simon Glass
2019-10-21  3:38 ` [U-Boot] [PATCH v3 076/108] spi: ich: Move init function just above probe() Simon Glass
2019-11-19 13:52   ` Bin Meng
2019-10-21  3:38 ` [U-Boot] [PATCH v3 077/108] spi: ich: Move the protection/lockdown code into a function Simon Glass
2019-11-19 13:53   ` Bin Meng
2019-11-19 17:53     ` Simon Glass
2019-11-20 12:55       ` Bin Meng
2019-10-21  3:38 ` [U-Boot] [PATCH v3 078/108] spi: ich: Convert to livetree Simon Glass
2019-11-19 13:53   ` Bin Meng
2019-10-21  3:38 ` [U-Boot] [PATCH v3 079/108] spi: ich: Fix header order Simon Glass
2019-11-19 13:53   ` Bin Meng
2019-10-21  3:38 ` [U-Boot] [PATCH v3 080/108] spi: ich: Various small tidy-ups Simon Glass
2019-11-19 13:53   ` Bin Meng
2019-10-21  3:38 ` [U-Boot] [PATCH v3 081/108] spi: ich: Add mmio_base to struct ich_spi_platdata Simon Glass
2019-11-19 14:36   ` Bin Meng
2019-11-19 17:53     ` Simon Glass
2019-11-20 12:52       ` Bin Meng
2019-11-21 13:50         ` Simon Glass
2019-10-21  3:38 ` [U-Boot] [PATCH v3 082/108] spi: ich: Correct max-size bug in ich_spi_adjust_size() Simon Glass
2019-11-19 14:36   ` Bin Meng
2019-11-21 13:50     ` Simon Glass
2019-11-21 14:04       ` Bin Meng
2019-10-21  3:38 ` [U-Boot] [PATCH v3 083/108] spi: ich: Support of-platdata for fast-spi Simon Glass
2019-11-19 14:36   ` Bin Meng
2019-11-19 17:53     ` Simon Glass
2019-11-20 12:48       ` Bin Meng
2019-11-21 13:50         ` Simon Glass
2019-10-21  3:38 ` [U-Boot] [PATCH v3 084/108] spi: ich: Support hardware sequencing Simon Glass
2019-11-19 14:36   ` Bin Meng
2019-10-21  3:38 ` [U-Boot] [PATCH v3 085/108] spi: ich: Add support for get_mmap() method Simon Glass
2019-11-19 14:36   ` Bin Meng
2019-11-21 13:50     ` Simon Glass
2019-10-21  3:38 ` [U-Boot] [PATCH v3 086/108] spi: ich: Add TPL support Simon Glass
2019-11-19 14:52   ` Bin Meng
2019-11-21 13:50     ` Simon Glass
2019-10-21  3:38 ` [U-Boot] [PATCH v3 087/108] spi: ich: Add Apollolake support Simon Glass
2019-11-19 14:52   ` Bin Meng
2019-10-21  3:38 ` [U-Boot] [PATCH v3 088/108] mtd: spi: Export spi_flash_std_probe() Simon Glass
2019-11-19 14:52   ` Bin Meng
2019-10-21  3:38 ` [U-Boot] [PATCH v3 089/108] x86: apollolake: Add basic IO addresses Simon Glass
2019-11-19 14:52   ` Bin Meng
2019-10-21  3:38 ` [U-Boot] [PATCH v3 090/108] x86: apollolake: Add PMC driver Simon Glass
2019-10-21  3:38 ` [U-Boot] [PATCH v3 091/108] x86: apollolake: Add low-power subsystem (lpss) support Simon Glass
2019-10-21  8:14   ` Andy Shevchenko
2019-10-21  3:38 ` [U-Boot] [PATCH v3 092/108] x86: apollolake: Add UART driver Simon Glass
2019-10-21  7:46   ` Andy Shevchenko
2019-10-21 22:53     ` Simon Glass
2019-10-22  8:21       ` Andy Shevchenko
2019-10-21  3:38 ` [U-Boot] [PATCH v3 093/108] x86: apollolake: Add GPIO driver Simon Glass
2019-10-21  7:57   ` Andy Shevchenko
2019-10-21  3:38 ` [U-Boot] [PATCH v3 094/108] i2c: designware: Add apollolake support Simon Glass
2019-10-28  4:47   ` Heiko Schocher
2019-10-21  3:39 ` [U-Boot] [PATCH v3 095/108] x86: apollolake: Add systemagent driver Simon Glass
2019-10-21  8:16   ` Andy Shevchenko
2019-10-21  3:39 ` [U-Boot] [PATCH v3 096/108] x86: apollolake: Add hostbridge driver Simon Glass
2019-10-21  3:39 ` [U-Boot] [PATCH v3 097/108] x86: apollolake: Add ITSS driver Simon Glass
2019-10-21  8:41   ` Andy Shevchenko
2019-10-21  8:43     ` Andy Shevchenko
2019-10-21 22:53       ` Simon Glass
2019-10-22  8:22         ` Andy Shevchenko
2019-10-22 13:50           ` Simon Glass
2019-10-22 18:56             ` Andy Shevchenko
2019-10-21  3:39 ` [U-Boot] [PATCH v3 098/108] x86: apollolake: Add LPC driver Simon Glass
2019-10-21  3:39 ` [U-Boot] [PATCH v3 099/108] x86: apollolake: Add PCH driver Simon Glass
2019-10-21  3:39 ` [U-Boot] [PATCH v3 100/108] x86: apollolake: Add PUNIT driver Simon Glass
2019-10-21  8:47   ` Andy Shevchenko
2019-10-21  3:39 ` [U-Boot] [PATCH v3 101/108] x86: apollolake: Add SPL loaders Simon Glass
2019-10-21  3:39 ` [U-Boot] [PATCH v3 102/108] x86: apollolake: Add a CPU driver Simon Glass
2019-10-21  3:39 ` [U-Boot] [PATCH v3 103/108] x86: apollolake: Add SPL/TPL init Simon Glass
2019-10-21  3:39 ` [U-Boot] [PATCH v3 104/108] x86: apollolake: Add P2SB driver Simon Glass
2019-10-21  8:49   ` Andy Shevchenko
2019-10-21 22:53     ` Simon Glass
2019-10-21  3:39 ` [U-Boot] [PATCH v3 105/108] x86: apollolake: Add Kconfig and Makefile Simon Glass
2019-10-21  3:39 ` [U-Boot] [PATCH v3 106/108] x86: apollolake: Add FSP structures Simon Glass
2019-10-21  3:39 ` [U-Boot] [PATCH v3 107/108] x86: apollolake: Add FSP support Simon Glass
2019-10-21  3:39 ` [U-Boot] [PATCH v3 108/108] x86: Add chromebook_coral Simon Glass
2019-10-21 19:15 ` [U-Boot] [PATCH v3 022/108] x86: timer: Use a separate flag for whether timer is inited Park, Aiden
2019-10-28  7:12 ` Bin Meng
2019-11-02  9:47   ` Bin Meng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191021033913.220758-45-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.