blob: ff78598f8ee114142a4d0425728206bfa15f68ec [file] [log] [blame]
Googlerfc3e29a2022-11-22 14:17:45 +08001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright 2021 Google LLC
4 */
5
6#ifndef _CHROMECAST_PARTITION_H_
7#define _CHROMECAST_PARTITION_H_
8
9#include <blk.h>
10
11#define CHROMECAST_PARTITION_ENTRY_NUMBERS CONFIG_EFI_PARTITION_ENTRIES_NUMBERS
12
13typedef enum {
14 CHROMECAST_PARTITION_MIGRATE_OP_NONE = 0,
15 CHROMECAST_PARTITION_MIGRATE_OP_ERASE,
16} chromecast_partition_migrate_op_t;
17
18typedef struct {
19 const char *name;
20 uint64_t start;
21 uint64_t size;
22 chromecast_partition_migrate_op_t migrate_op;
23} chromecast_partition_t;
24
25typedef struct {
26 // Make sure that 'align' is a multiple of the device block size.
27 // For eMMC, make sure that it's also a multiple of the erase group
28 // size.
29 uint64_t align;
30 uint64_t reserved;
31 chromecast_partition_t partitions[CHROMECAST_PARTITION_ENTRY_NUMBERS];
32} chromecast_partition_table_t;
33
34int init_chromecast_partitions(
35 struct blk_desc *dev_desc,
36 const chromecast_partition_table_t *partition_table);
37
38#endif // _CHROMECAST_PARTITION_H_