summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorPeter Marheine <pmarheine@chromium.org>2019-12-19 11:37:39 -0800
committerCommit Bot <commit-bot@chromium.org>2020-01-07 03:33:48 +0000
commitfa18c654e2f39e373f5e209ac9751082e4ae56a1 (patch)
treef4ba6eebdaae5fdcb0b1f13d6bb555f551344466 /board
parent9ba4e7abf779f8309cb96e67348861336ca7c4cc (diff)
downloadchrome-ec-fa18c654e2f39e373f5e209ac9751082e4ae56a1.tar.gz
puff: enable EFS
Configs mostly copied from fizz. TEST=booted on hardware, observed successful jump to RW. BRANCH=none BUG=b:146504182 Change-Id: Icf2925b92fea848efcd705bb5274d1afc91d2513 Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1977079 Reviewed-by: Andrew McRae <amcrae@chromium.org> Commit-Queue: Andrew McRae <amcrae@chromium.org>
Diffstat (limited to 'board')
-rw-r--r--board/puff/board.c5
-rw-r--r--board/puff/board.h49
-rw-r--r--board/puff/dev_key.pem39
3 files changed, 91 insertions, 2 deletions
diff --git a/board/puff/board.c b/board/puff/board.c
index 80ebedf7c2..3a846736a5 100644
--- a/board/puff/board.c
+++ b/board/puff/board.c
@@ -510,3 +510,8 @@ void board_overcurrent_event(int port, int is_overcurrented)
return;
usbc_overcurrent = is_overcurrented;
}
+
+enum battery_present battery_is_present(void)
+{
+ return BP_NO;
+}
diff --git a/board/puff/board.h b/board/puff/board.h
index 942ddc122c..0188c89662 100644
--- a/board/puff/board.h
+++ b/board/puff/board.h
@@ -42,13 +42,51 @@
#define CONFIG_HOSTCMD_ESPI
#define CONFIG_LED_COMMON
#undef CONFIG_LID_SWITCH
+#define CONFIG_LTO
#define CONFIG_PWM
-#define CONFIG_SHA256
-#define CONFIG_SHA256_UNROLLED
+#define CONFIG_VBOOT_EFS
#define CONFIG_VBOOT_HASH
#define CONFIG_VSTORE
#define CONFIG_VSTORE_SLOT_COUNT 1
+/*
+ * Override Flash layout for EFS.
+ *
+ * 3 images are stored: RO, RW-A and RW-B. RO must be one of 64k, 128k or 256k
+ * in size to be correctly protected by the hardware block protection. RW must
+ * be the same size as RO, so divide the flash into four equal-size blocks.
+ *
+ * A public key is stored at the end of RO. Signatures are stored at the
+ * end of RW_A and RW_B, respectively.
+ */
+#define CONFIG_RW_B
+#define CONFIG_RW_B_MEM_OFF CONFIG_RO_MEM_OFF
+#undef CONFIG_RO_SIZE
+#define CONFIG_RO_SIZE (CONFIG_FLASH_SIZE / 4)
+#undef CONFIG_RW_SIZE
+#define CONFIG_RW_SIZE CONFIG_RO_SIZE
+#define CONFIG_RW_A_STORAGE_OFF CONFIG_RW_STORAGE_OFF
+#define CONFIG_RW_B_STORAGE_OFF (CONFIG_RW_A_STORAGE_OFF + \
+ CONFIG_RW_SIZE)
+#define CONFIG_RW_A_SIGN_STORAGE_OFF (CONFIG_RW_A_STORAGE_OFF + \
+ CONFIG_RW_SIZE - CONFIG_RW_SIG_SIZE)
+#define CONFIG_RW_B_SIGN_STORAGE_OFF (CONFIG_RW_B_STORAGE_OFF + \
+ CONFIG_RW_SIZE - CONFIG_RW_SIG_SIZE)
+
+#define CONFIG_RWSIG
+#define CONFIG_RWSIG_TYPE_RWSIG
+#define CONFIG_RSA
+#ifdef SECTION_IS_RO
+#define CONFIG_RSA_OPTIMIZED
+#endif
+#define CONFIG_SHA256
+#ifdef SECTION_IS_RO
+#define CONFIG_SHA256_UNROLLED
+#endif
+#define CONFIG_RSA_KEY_SIZE 3072
+#define CONFIG_RSA_EXPONENT_3
+
+
#define CONFIG_SUPPRESSED_HOST_COMMANDS \
EC_CMD_CONSOLE_SNAPSHOT, EC_CMD_CONSOLE_READ, EC_CMD_PD_GET_LOG_ENTRY
@@ -61,6 +99,13 @@
#define CONFIG_CMD_PD_CONTROL
#undef CONFIG_CMD_PWR_AVG
#define CONFIG_CMD_PPC_DUMP
+#ifdef SECTION_IS_RO
+/* Reduce RO size by removing less-relevant commands. */
+#undef CONFIG_CMD_APTHROTTLE
+#undef CONFIG_CMD_CHARGEN
+#undef CONFIG_CMD_HCDEBUG
+#undef CONFIG_CMD_MMAPINFO
+#endif
/* Don't generate host command debug by default */
#undef CONFIG_HOSTCMD_DEBUG_MODE
diff --git a/board/puff/dev_key.pem b/board/puff/dev_key.pem
new file mode 100644
index 0000000000..42cb24e3be
--- /dev/null
+++ b/board/puff/dev_key.pem
@@ -0,0 +1,39 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIG4wIBAAKCAYEA7AgQW6javwALyH5Wc57FAUEWIeurG1mGptWdcZtum5TnGns0
+ZJ2LFKbb80V1j5Jk4RGJd5GMlhmyMcJzwtGtFnP5jHlYTcKO3ORjySIC7ivGpJwn
+BXbdeg61Zhoa8cRWc2UDngmPYiAA0KZXzsTitfJ08L+5H3tTXPmQgFPbeAR0AjG4
+WFewK8F+kC4mD4UZYzs4/v46BEZzLDxj1IfRGoEtWvskMzKHU0A8+PZeZ2w0zBi9
+M4WgOLMm26gEURHLqqG/SwjUuyqCYq+7Jilh/eQxNt5/BALMa83sag/BM4bW0STN
+Gqgn8Z0DslbesFBDrUZRXE65WpY+7rkVvLEa7yEkz2s7t2pNJeZuHrBoWpKJYkN8
+sMHoW6eBGfmUAxcufQJwv/7W4dMsXLtt4YcSYwABTOxFH00nRNMyn0jzNWM7sRdV
+RUKvm5YB+o/iL33QDltTiIPnqv61Mck+Z1yW+MdVmFTksrsk1Owmb+UszGL4czNW
+R+LYoCBDku0tS2LRAgEDAoIBgQCdWrWScJHUqrKFqY73vy4A1g7BR8dnkQRvOROh
+Ekm9De9m/M2YaQdjGef3g6O1DENAtlulC7MOu8whLE0si8i5oqZdpjregbSTQu0w
+wVdJcoRtvW9Y+ej8Cc5EEWdL2DmiQ1e+sQpBaqs1xDqJ2Jcj9vigf9C/p4zopmBV
+jTz6raKsISWQOnVygP8KyW61A2ZCJ3tUqXwC2aIdfZfjBTYRq3OR/MLMzFo3gCil
++ZRE8s3dZdN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