mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-31 02:51:26 +00:00
hammer: Better RO/RB/RW split: 44/4/80 kB
Let's future proof hammer a bit: current flash usage, after
applying uncommmited patches, is about 36/50 kB for RO/RW respectively.
Let's change the RO/RB/RW layout from 64/4/60 kB to 44/4/80 kB.
BRANCH=none
BUG=b:38489464
TEST=Enable CONFIG_CMD_FLASH and force WP_L low.
TEST=flashwrite 0xa000 0x100 => ok
flashwp true; reboot
flashinfo => ro_at_boot ro_now
YYYYYYYY YYY..... ........ ........
flashread 0xa000 0x100 => Incrementing numbers 0->255
flasherase 0xa000 0x800 => error
flashread 0xa000 0x800 => Incrementing numbers 0->255
TEST=(rollback)
rollbackupdate 2 => works, rollbackinfo is correct
flashwp rb; reboot
flashread 0xb000 0x100 => Rollback info followed by 0xff
flasherase 0xb000 0x800 => error
flashread 0xb000 0x800 => Unchanged
rollbackupdate 3 => fails
TEST=(rw)
flashwp rw; reboot
flashinfo => all_at_boot all_now
flashread 0x0c000 0x100
flasherase 0x0c000 0x800 => Access denied
flashread 0x0c000 0x100
flashread 0x1f800 0x100 => 0xff
flashwrite 0x1f800 0x100 => Access denied
flashread 0x1f800 0x100
TEST=(norw)
flashwp norw; reboot
flasherase 0x0c000 0x800 => ok
flashread 0x0c000 0x100 => 0xff
flashwrite 0x0c000 0x100
flashread 0x0c000 0x100 => Incrementing numbers 0->255
reboot => RW does not verify anymore
TEST=(norb)
flashwp norb
flasherase 0xb000 0x800
flashwrite 0xb000 0x100
rollbackinfo => block 0 shows incorrect values.
Change-Id: I915ffe3032e6a70f761c5f7ea2940feaae58366b
Reviewed-on: https://chromium-review.googlesource.com/510413
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
committed by
chrome-bot
parent
e42da5ace4
commit
e58472daf8
@@ -38,12 +38,6 @@
|
||||
#undef CONFIG_WP_STORAGE_OFF
|
||||
#undef CONFIG_WP_STORAGE_SIZE
|
||||
|
||||
#define _IMAGE_SIZE (CONFIG_FLASH_SIZE / 2)
|
||||
|
||||
/* EC rollback protection block */
|
||||
#define CONFIG_ROLLBACK_OFF _IMAGE_SIZE
|
||||
#define CONFIG_ROLLBACK_SIZE CONFIG_FLASH_BANK_SIZE
|
||||
|
||||
#define CONFIG_FLASH_PSTATE
|
||||
/* Do not use a dedicated PSTATE bank */
|
||||
#undef CONFIG_FLASH_PSTATE_BANK
|
||||
@@ -52,10 +46,16 @@
|
||||
|
||||
#define CONFIG_RO_MEM_OFF 0
|
||||
#define CONFIG_RO_STORAGE_OFF 0
|
||||
#define CONFIG_RO_SIZE _IMAGE_SIZE
|
||||
#define CONFIG_RW_MEM_OFF (_IMAGE_SIZE + CONFIG_ROLLBACK_SIZE)
|
||||
#define CONFIG_RO_SIZE (44*1024)
|
||||
|
||||
/* EC rollback protection block */
|
||||
#define CONFIG_ROLLBACK_OFF (CONFIG_RO_MEM_OFF + CONFIG_RO_SIZE)
|
||||
#define CONFIG_ROLLBACK_SIZE CONFIG_FLASH_BANK_SIZE
|
||||
|
||||
#define CONFIG_RW_MEM_OFF (CONFIG_ROLLBACK_OFF + CONFIG_ROLLBACK_SIZE)
|
||||
#define CONFIG_RW_STORAGE_OFF 0
|
||||
#define CONFIG_RW_SIZE (_IMAGE_SIZE - CONFIG_ROLLBACK_SIZE)
|
||||
#define CONFIG_RW_SIZE (CONFIG_FLASH_SIZE - \
|
||||
(CONFIG_RW_MEM_OFF - CONFIG_RO_MEM_OFF))
|
||||
|
||||
#define CONFIG_EC_PROTECTED_STORAGE_OFF CONFIG_RO_MEM_OFF
|
||||
#define CONFIG_EC_PROTECTED_STORAGE_SIZE CONFIG_RO_SIZE
|
||||
|
||||
Reference in New Issue
Block a user