From f3f7fca07fbcb6bb9655a71257f09c71b0a1458d Mon Sep 17 00:00:00 2001 From: Dan Ehrenberg Date: Fri, 2 Jan 2015 14:39:38 -0800 Subject: nand: vboot support for small GPTs This patch makes some small modifications to cgpt and vboot to root out the last vestigates of a fixed 128-entry GPT: - Get rid of the TOTAL_ENTRIES_SIZE constant and all users. - Reduce MAX_NUMBER_OF_ENTRIES to 128 (which is what the GPT spec specifies) so that this can be used for things like memory allocations without additional overhead. - Base the amount of GPT read/written on the number of entries specified in the GPT header on disk/flash. BUG=chromium:433433 TEST=make runalltests TEST=Modified fmap to make an 8k RW_GPT, wrote a GPT with cgpt, then rebooted and found that the GPT was correctly read after restarting and the appropriate mtd partitions were present. BRANCH=none Change-Id: I45317377da20259caf04a7a4fa077a892b03c45f Signed-off-by: Dan Ehrenberg Reviewed-on: https://chromium-review.googlesource.com/238245 Reviewed-by: Randall Spangler --- firmware/lib/cgptlib/include/cgptlib_internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'firmware/lib/cgptlib/include/cgptlib_internal.h') diff --git a/firmware/lib/cgptlib/include/cgptlib_internal.h b/firmware/lib/cgptlib/include/cgptlib_internal.h index b4e2f5f9..0be2bc5a 100644 --- a/firmware/lib/cgptlib/include/cgptlib_internal.h +++ b/firmware/lib/cgptlib/include/cgptlib_internal.h @@ -52,7 +52,7 @@ #define MAX_SIZE_OF_ENTRY 512 #define SIZE_OF_ENTRY_MULTIPLE 8 #define MIN_NUMBER_OF_ENTRIES 16 -#define MAX_NUMBER_OF_ENTRIES 512 +#define MAX_NUMBER_OF_ENTRIES 128 /* Defines GPT sizes */ #define GPT_PMBR_SECTORS 1 /* size (in sectors) of PMBR */ -- cgit v1.2.1