summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2015-09-20 16:14:02 -0700
committerchrome-bot <chrome-bot@chromium.org>2015-09-21 10:04:35 -0700
commit7323fd8fdafc4c8c0d751bc24e9e64740c624588 (patch)
treedf265c5cb3f8e1c9637de3702ed781012ea895f4
parent40e20adefbb46dac71e781473388b33b41f7ff45 (diff)
downloadchrome-ec-7323fd8fdafc4c8c0d751bc24e9e64740c624588.tar.gz
cleanup: Put chip-specific configs in config_chip.h
include/config_std_internal_flash.h is an optional header that can be used to implement the most common EC flash layout. However, CONFIG_INTERNAL_STORAGE, CONFIG_MAPPED_STORAGE, and CONFIG_MAPPED_STORAGE_BASE are fixed by the SoC, so they belong in config_chip.h, not in the optional header. BRANCH=none BUG=chrome-os-partner:23796 TEST=make buildall Refactoring only, no behavioral differences. Change-Id: I114c3e194837041920e6f228a2bed6747be8231c Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/301330 Reviewed-by: Shawn N <shawnn@chromium.org>
-rw-r--r--chip/g/config_chip.h7
-rw-r--r--chip/host/config_chip.h8
-rw-r--r--chip/it83xx/config_chip.h8
-rw-r--r--chip/lm4/config_chip.h8
-rw-r--r--chip/nrf51/config_chip.h8
-rw-r--r--chip/stm32/config_chip.h8
-rw-r--r--include/config_std_internal_flash.h9
7 files changed, 48 insertions, 8 deletions
diff --git a/chip/g/config_chip.h b/chip/g/config_chip.h
index 149fea8c34..14d5ead8d6 100644
--- a/chip/g/config_chip.h
+++ b/chip/g/config_chip.h
@@ -29,6 +29,13 @@
#define CONFIG_FLASH_SIZE (512 * 1024)
#define CONFIG_RO_HEAD_ROOM 1024 /* Room for ROM signature. */
+/* Memory-mapped internal flash */
+#define CONFIG_INTERNAL_STORAGE
+#define CONFIG_MAPPED_STORAGE
+
+/* Program is run directly from storage */
+#define CONFIG_MAPPED_STORAGE_BASE CONFIG_PROGRAM_MEMORY_BASE
+
/* Compute the rest of the flash params from these */
#include "config_std_internal_flash.h"
diff --git a/chip/host/config_chip.h b/chip/host/config_chip.h
index b8d46c47ac..17bd46cf88 100644
--- a/chip/host/config_chip.h
+++ b/chip/host/config_chip.h
@@ -22,6 +22,14 @@ extern char __host_flash[CONFIG_FLASH_SIZE];
#define CONFIG_FPU
+/* Memory-mapped internal flash */
+#define CONFIG_INTERNAL_STORAGE
+#define CONFIG_MAPPED_STORAGE
+
+/* Program is run directly from storage */
+#define CONFIG_MAPPED_STORAGE_BASE CONFIG_PROGRAM_MEMORY_BASE
+
+/* Compute the rest of the flash params from these */
#include "config_std_internal_flash.h"
/* Maximum number of deferrable functions */
diff --git a/chip/it83xx/config_chip.h b/chip/it83xx/config_chip.h
index 1d88e7df4f..b05fc1d338 100644
--- a/chip/it83xx/config_chip.h
+++ b/chip/it83xx/config_chip.h
@@ -64,6 +64,14 @@
/****************************************************************************/
/* Define our flash layout. */
+/* Memory-mapped internal flash */
+#define CONFIG_INTERNAL_STORAGE
+#define CONFIG_MAPPED_STORAGE
+
+/* Program is run directly from storage */
+#define CONFIG_MAPPED_STORAGE_BASE CONFIG_PROGRAM_MEMORY_BASE
+
+/* Compute the rest of the flash params from these */
#include "config_std_internal_flash.h"
/****************************************************************************/
diff --git a/chip/lm4/config_chip.h b/chip/lm4/config_chip.h
index fd7c0cd2c3..bae83e23f7 100644
--- a/chip/lm4/config_chip.h
+++ b/chip/lm4/config_chip.h
@@ -69,6 +69,14 @@
/****************************************************************************/
/* Define our flash layout. */
+/* Memory-mapped internal flash */
+#define CONFIG_INTERNAL_STORAGE
+#define CONFIG_MAPPED_STORAGE
+
+/* Program is run directly from storage */
+#define CONFIG_MAPPED_STORAGE_BASE CONFIG_PROGRAM_MEMORY_BASE
+
+/* Compute the rest of the flash params from these */
#include "config_std_internal_flash.h"
/****************************************************************************/
diff --git a/chip/nrf51/config_chip.h b/chip/nrf51/config_chip.h
index cade6fed97..82ac548477 100644
--- a/chip/nrf51/config_chip.h
+++ b/chip/nrf51/config_chip.h
@@ -43,6 +43,14 @@
#define CONFIG_FLASH_SIZE 0x00040000
#define CONFIG_FLASH_BANK_SIZE 0x1000
+/* Memory-mapped internal flash */
+#define CONFIG_INTERNAL_STORAGE
+#define CONFIG_MAPPED_STORAGE
+
+/* Program is run directly from storage */
+#define CONFIG_MAPPED_STORAGE_BASE CONFIG_PROGRAM_MEMORY_BASE
+
+/* Compute the rest of the flash params from these */
#include "config_std_internal_flash.h"
/* Number of IRQ vectors on the NVIC */
diff --git a/chip/stm32/config_chip.h b/chip/stm32/config_chip.h
index 3668d1b7e5..571f8ae015 100644
--- a/chip/stm32/config_chip.h
+++ b/chip/stm32/config_chip.h
@@ -45,6 +45,14 @@
#define CONFIG_PROGRAM_MEMORY_BASE 0x08000000
+/* Memory-mapped internal flash */
+#define CONFIG_INTERNAL_STORAGE
+#define CONFIG_MAPPED_STORAGE
+
+/* Program is run directly from storage */
+#define CONFIG_MAPPED_STORAGE_BASE CONFIG_PROGRAM_MEMORY_BASE
+
+/* Compute the rest of the flash params from these */
#include "config_std_internal_flash.h"
/* System stack size */
diff --git a/include/config_std_internal_flash.h b/include/config_std_internal_flash.h
index ad97110547..cfe31773ea 100644
--- a/include/config_std_internal_flash.h
+++ b/include/config_std_internal_flash.h
@@ -32,18 +32,11 @@
* TODO(crosbug.com/p/23796): Finish implementing the spec.
*/
-/* Memory-mapped internal flash w/ PSTATE */
-#define CONFIG_INTERNAL_STORAGE
-#define CONFIG_MAPPED_STORAGE
-#define CONFIG_FLASH_PSTATE
-
-/* Program is run directly from storage */
-#define CONFIG_MAPPED_STORAGE_BASE CONFIG_PROGRAM_MEMORY_BASE
-
/*
* The EC uses the one bank of flash to emulate a SPI-like write protect
* register with persistent state.
*/
+#define CONFIG_FLASH_PSTATE
#define CONFIG_FW_PSTATE_SIZE CONFIG_FLASH_BANK_SIZE
#define CONFIG_FW_PSTATE_OFF (CONFIG_FW_IMAGE_SIZE - CONFIG_FW_PSTATE_SIZE)