-
Notifications
You must be signed in to change notification settings - Fork 19
/
emmc_partitions.h
executable file
·98 lines (77 loc) · 2.68 KB
/
emmc_partitions.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#ifndef _AML_MMC_H
#define _AML_MMC_H
#include <asm/io.h>
#include <config.h>
#include <common.h>
#include <command.h>
#include <mmc.h>
#include <part.h>
#include <malloc.h>
#include <linux/list.h>
#include <mmc.h>
#include <div64.h>
#include <environment.h>
#include <malloc.h>
#include <asm/cache.h>
#include <asm/arch/reboot.h>
#include <asm/arch/clock.h>
#include <asm/sizes.h>
#include<partition_table.h>
#include <asm/arch/storage.h>
#define AML_MMC_DBG
#define MAX_DEVICE_NUM 16
#define MAX_DEVICE_NAME_LEN 16
#define MAX_MMC_PART_NUM 16
#define MAX_MMC_PART_NAME_LEN 16
#define PARTITION_RESERVED (8*SZ_1M) // 8MB
#define MMC_BOOT_PARTITION_RESERVED (32*SZ_1M) // 32MB
#define MMC_BOOT_NAME "bootloader"
#define MMC_BOOT_DEVICE_SIZE (0x4*SZ_1M)
#define MMC_RESERVED_NAME "reserved"
#define MMC_RESERVED_SIZE (64*SZ_1M)
#define MMC_CACHE_NAME "cache"
// #define MMC_CACHE_SIZE (512*SZ_1M) // this is not used and should be get from spl
#define MMC_ENV_NAME "env"
#define MMC_ENV_SIZE (8*SZ_1M)
// #define MMC_KEY_NAME "key"
// #define MMC_KEY_SIZE (0x1*SZ_1M)
// #define MMC_SECURE_NAME "secure"
// #define MMC_SECURE_SIZE (0x1*SZ_1M)
#define MMC_UBOOT_VERSION "01.00.00"
#define MMC_PARTITIONS_MAGIC "MPT" // MMC Partition Table
#define MMC_CARD_PARTITION_NAME "card"
#ifdef AML_MMC_DBG
#define aml_mmc_dbg(fmt, ...) printk( "%s: line:%d " fmt "\n", \
__func__, __LINE__, ##__VA_ARGS__)
#define aml_mmc_msg(fmt, ...) printk( "%s: line:%d " fmt "\n", \
__func__, __LINE__, ##__VA_ARGS__)
#else
#define aml_mmc_dbg(fmt, ...)
#define aml_mmc_msg(fmt, ...) printk( fmt "\n", ##__VA_ARGS__)
#endif
struct mmc_partitions_fmt {
char magic[4];
unsigned char version[12];
int part_num;
int checksum;
struct partitions partitions[MAX_MMC_PART_NUM];
};
struct mmc_config{
unsigned char version[12];
int part_num;
struct partitions partitions[MAX_MMC_PART_NUM];
unsigned option;
void * private_data;
};
/*
struct _mmc_device{
char name[MAX_DEVICE_NAME_LEN];
uint64_t offset;
uint64_t size;
void * private_data;
struct list_head list;
};
*/
extern bool is_partition_checked;
struct partitions* find_mmc_partition_by_name (char *name);
#endif