Martin L Roth has uploaded this change for review.

View Change

src: De-conflict CALIBRATION_REGION definitions

Change the name of the CALIBRATION_REGION definitions used in two
separate locations. This conflict was causing an error for the
lint-001-no-global-config-in-romstage test.

Signed-off-by: Martin Roth <gaumless@gmail.com>
Change-Id: If6734f2a7d9be669586ea350fb9979fcd422b591
---
M src/mainboard/google/kukui/romstage.c
M src/soc/mediatek/common/memory.c
2 files changed, 24 insertions(+), 10 deletions(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/82/67382/1
diff --git a/src/mainboard/google/kukui/romstage.c b/src/mainboard/google/kukui/romstage.c
index b9c0d2c..0a13a3d 100644
--- a/src/mainboard/google/kukui/romstage.c
+++ b/src/mainboard/google/kukui/romstage.c
@@ -13,16 +13,16 @@
#include "early_init.h"

/* This must be defined in chromeos.fmd in same name and size. */
-#define CALIBRATION_REGION "RW_DDR_TRAINING"
-#define CALIBRATION_REGION_SIZE 0x2000
+#define CAL_REGION_RW_DDR_TRAINING "RW_DDR_TRAINING"
+#define CAL_REGION_RW_DDR_TRAINING_SIZE 0x2000

-_Static_assert(sizeof(struct dramc_param) <= CALIBRATION_REGION_SIZE,
- "sizeof(struct dramc_param) exceeds " CALIBRATION_REGION);
+_Static_assert(sizeof(struct dramc_param) <= CAL_REGION_RW_DDR_TRAINING_SIZE,
+ "sizeof(struct dramc_param) exceeds " CAL_REGION_RW_DDR_TRAINING);

static bool read_calibration_data_from_flash(struct dramc_param *dparam)
{
const size_t length = sizeof(*dparam);
- size_t ret = fmap_read_area(CALIBRATION_REGION, dparam, length);
+ size_t ret = fmap_read_area(CAL_REGION_RW_DDR_TRAINING, dparam, length);
printk(BIOS_DEBUG, "%s: ret=%#lx, length=%#lx\n",
__func__, ret, length);

@@ -32,7 +32,7 @@
static bool write_calibration_data_to_flash(const struct dramc_param *dparam)
{
const size_t length = sizeof(*dparam);
- size_t ret = fmap_overwrite_area(CALIBRATION_REGION, dparam, length);
+ size_t ret = fmap_overwrite_area(CAL_REGION_RW_DDR_TRAINING, dparam, length);
printk(BIOS_DEBUG, "%s: ret=%#lx, length=%#lx\n",
__func__, ret, length);

diff --git a/src/soc/mediatek/common/memory.c b/src/soc/mediatek/common/memory.c
index 1771313..f3f784e 100644
--- a/src/soc/mediatek/common/memory.c
+++ b/src/soc/mediatek/common/memory.c
@@ -15,11 +15,11 @@
#include <timer.h>

/* This must be defined in chromeos.fmd in same name and size. */
-#define CALIBRATION_REGION "RW_MRC_CACHE"
-#define CALIBRATION_REGION_SIZE 0x2000
+#define CAL_REGION_RW_MRC_CACHE "RW_MRC_CACHE"
+#define CAL_REGION_RW_MRC_CACHE_SIZE 0x2000

-_Static_assert(sizeof(struct dramc_param) <= CALIBRATION_REGION_SIZE,
- "sizeof(struct dramc_param) exceeds " CALIBRATION_REGION);
+_Static_assert(sizeof(struct dramc_param) <= CAL_REGION_RW_MRC_CACHE_SIZE,
+ "sizeof(struct dramc_param) exceeds " CAL_REGION_RW_MRC_CACHE);

const char *get_dram_geometry_str(u32 ddr_geometry);
const char *get_dram_type_str(u32 ddr_type);

To view, visit change 67382. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: If6734f2a7d9be669586ea350fb9979fcd422b591
Gerrit-Change-Number: 67382
Gerrit-PatchSet: 1
Gerrit-Owner: Martin L Roth <gaumless@gmail.com>
Gerrit-MessageType: newchange