summaryrefslogtreecommitdiff
path: root/include/partition_table.h (plain)
blob: 9a6744da1f3f6854de36638050f155288a0eca6e
1#ifndef _PARTITION_TABLE_H
2#define _PARTITION_TABLE_H
3// #ifdef CONFIG_STORE_COMPATIBLE
4#include <storage.h>
5// #endif
6//#include <asm/arch/nand.h>
7//#include <asm/arch/poc.h>
8
9
10//#define STORE_DBG
11#ifdef STORE_DBG
12#define store_dbg(fmt, ...) printk( "%s: line:%d " fmt "\n", \
13 __func__, __LINE__, ##__VA_ARGS__)
14
15#define store_msg(fmt, ...) printk( "%s: line:%d " fmt "\n", \
16 __func__, __LINE__, ##__VA_ARGS__)
17#else
18#define store_dbg(fmt, ...)
19#define store_msg(fmt, ...) printk( fmt "\n", ##__VA_ARGS__)
20#endif
21
22//boot_flag
23//#define R_BOOT_DEVICE_FLAG READ_CBUS_REG(ASSIST_POR_CONFIG)
24
25//#if MESON_CPU_TYPE >= MESON_CPU_TYPE_MESON8
26//#define POR_BOOT_VALUE ((((R_BOOT_DEVICE_FLAG>>9)&1)<<2)|((R_BOOT_DEVICE_FLAG>>6)&3))
27//#else
28//#define POR_BOOT_VALUE (R_BOOT_DEVICE_FLAG & 7)
29//#endif
30
31//#if 1 /*defined in poc.h*/
32//#define POR_NAND_BOOT() ((POR_BOOT_VALUE == 7) || (POR_BOOT_VALUE == 6))
33//#define POR_SPI_BOOT() ((POR_BOOT_VALUE == 5) || (POR_BOOT_VALUE == 4))
34//#define POR_EMMC_BOOT() ((IS_MESON_M8M2_CPU | IS_MESON_M8BABY_CPU)?((POR_BOOT_VALUE == 3) || ((POR_BOOT_VALUE == 1))):(POR_BOOT_VALUE == 3))
35//#define POR_CARD_BOOT() (POR_BOOT_VALUE == 0)
36//#endif
37
38#define SPI_BOOT_FLAG 0
39#define NAND_BOOT_FLAG 1
40#define EMMC_BOOT_FLAG 2
41#define CARD_BOOT_FLAG 3
42#define SPI_NAND_FLAG 4
43#define SPI_EMMC_FLAG 5
44
45#define _AML_DEVICE_BOOT_FLAG_DEFAULT (0XFFFFFFFF)
46extern unsigned device_boot_flag;
47
48#define START_ADDR 0xd9000200
49#define TABLE_MAGIC_NAME "part"
50#define STORE_MAGIC_NAME "stor"
51#define ACS_SET_LEN 128
52
53extern int info_disprotect;
54
55extern int has_boot_slot;
56extern int has_system_slot;
57extern bool dynamic_partition;
58
59#define DISPROTECT_KEY 1
60#define DISPROTECT_SECURE 1<<1
61#define DISPROTECT_FBBT 1<<2
62#define DISPROTECT_HYNIX 1<<3
63
64extern int get_partition_from_dts(unsigned char * buffer);
65
66extern int get_partitions_table(struct partitions **table);
67
68#define AML_DTB_IMG_MAX_SZ ((256<<10) - 512)
69extern struct partitions *get_partitions(void);
70
71extern int get_partition_count(void);
72extern void free_partitions(void);
73/* only nand&emmc for gxb and later soc */
74static inline int is_mainstorage_emmc(void) {return(device_boot_flag == EMMC_BOOT_FLAG);}
75static inline int is_mainstorage_nand(void) {return(device_boot_flag == NAND_BOOT_FLAG);}
76
77#endif// #ifndef _PARTITION_TABLE_H
78
79