summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorHaojian Zhuang <haojian.zhuang@linaro.org>2019-09-14 18:01:16 +0800
committerHaojian Zhuang <haojian.zhuang@linaro.org>2019-09-18 18:18:20 +0800
commitf8631f51392f0688c70cfd53dc66422404e00e16 (patch)
tree81558c0602493f47be62eb7d498bca2278980c31 /include
parent6129e9a643274e658a0e6f5428ad976676c7bb7a (diff)
drivers: partition: support different block size
The block size of some storage device is 4096-byte long, such as UFS. But PARTITION_BLOCK_SIZE is defined as 512-byte long. So replace it by PLAT_PARTITION_BLOCK_SIZE. Make it configurable in platform. Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org> Change-Id: Iada05f7c646d0a0f2c0d3b8545540b3cb7153de3
Diffstat (limited to 'include')
-rw-r--r--include/drivers/partition/gpt.h4
-rw-r--r--include/drivers/partition/partition.h10
2 files changed, 11 insertions, 3 deletions
diff --git a/include/drivers/partition/gpt.h b/include/drivers/partition/gpt.h
index 3ae160fd..d923e953 100644
--- a/include/drivers/partition/gpt.h
+++ b/include/drivers/partition/gpt.h
@@ -10,9 +10,9 @@
#include <drivers/partition/partition.h>
#define PARTITION_TYPE_GPT 0xee
-#define GPT_HEADER_OFFSET PARTITION_BLOCK_SIZE
+#define GPT_HEADER_OFFSET PLAT_PARTITION_BLOCK_SIZE
#define GPT_ENTRY_OFFSET (GPT_HEADER_OFFSET + \
- PARTITION_BLOCK_SIZE)
+ PLAT_PARTITION_BLOCK_SIZE)
#define GUID_LEN 16
#define GPT_SIGNATURE "EFI PART"
diff --git a/include/drivers/partition/partition.h b/include/drivers/partition/partition.h
index d94c7824..5f648337 100644
--- a/include/drivers/partition/partition.h
+++ b/include/drivers/partition/partition.h
@@ -17,7 +17,15 @@
CASSERT(PLAT_PARTITION_MAX_ENTRIES <= 128, assert_plat_partition_max_entries);
-#define PARTITION_BLOCK_SIZE 512
+#if !PLAT_PARTITION_BLOCK_SIZE
+# define PLAT_PARTITION_BLOCK_SIZE 512
+#endif /* PLAT_PARTITION_BLOCK_SIZE */
+
+CASSERT((PLAT_PARTITION_BLOCK_SIZE == 512) ||
+ (PLAT_PARTITION_BLOCK_SIZE == 4096),
+ assert_plat_partition_block_size);
+
+#define LEGACY_PARTITION_BLOCK_SIZE 512
#define EFI_NAMELEN 36