blob: 05510c4858f2804d6544b36d4adadac0ad38a908 [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001/******************************************************************************
2 *
3 * (C)Copyright 2005 - 2011 Marvell. All Rights Reserved.
4 *
5 * THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MARVELL.
6 * The copyright notice above does not evidence any actual or intended
7 * publication of such source code.
8 * This Module contains Proprietary Information of Marvell and should be
9 * treated as Confidential.
10 * The information in this file is provided for the exclusive use of the
11 * licensees of Marvell.
12 * Such users have the right to use, modify, and incorporate this code into
13 * products for purposes authorized by the license agreement provided they
14 * include this notice and the associated copyright notice with any such
15 * product.
16 * The information in this file is provided "AS IS" without warranty.
17
18 ******************************************************************************/
19
20#ifndef __Partition_H__
21#define __Partition_H__
22
23#include "Typedef.h"
24#include "BBM.h"
25
26//Marvell Master Partition Table ID: "MRVL MPT"
27#define MARVELL_PARTITION_TABLE_ID0 0x4D52564C
28#define MARVELL_PARTITION_TABLE_ID1 0x204D5054
29
30/* Partition Info values */
31//Type
32#define PI_TYPE_PHYSICAL 0x50687973 //"Phys"
33#define PI_TYPE_LOGICAL 0x4C6F6769 //"Logi"
34
35//Usage
36#define PI_USAGE_BOOT 0x424F4F54 //"Boot" Boot Partition
37#define PI_USAGE_OSLD 0x4F534C44 //"OSLD" OS Loader Partition
38#define PI_USAGE_KRNL 0x4B524E4C //"KRNL" Kernal Partition
39#define PI_USAGE_FFOS 0x46464F53 //"FFOS" FF OS Partition
40#define PI_USAGE_FSYS 0x46535953 //"FSYS" File System Partition
41
42//Partition Attributes
43typedef struct
44{
45 UINT ReadOnly : 1;
46 UINT Writable : 1;
47 UINT Executable : 1;
48 UINT Compressed : 1;
49 UINT CompressType : 4;
50 UINT Reserved : 24;
51} PartAttributes_T;
52
53//Reserved Pool Algorithm
54#define PI_RP_ALGO_NA 0x00000000 //Reserved Pool Not Used
55#define PI_RP_ALGO_UPWD 0x55505744 //"UPWD" Reserved Pool grows Upwards
56#define PI_RP_ALGO_DNWD 0x444E5744 //"DNWD" Reserved Pool grows Downwards
57
58/* End of Partition Info values */
59
60
61
62// Indicates the state of the PT in volatile memory
63typedef enum
64{
65 PT_INVALID = 1,
66 PT_VALID = 2,
67 PT_NEW = 3 //this means that either the PT was loaded externally, OR block 0 was erased
68} PTState_T;
69
70//Partition table structure:
71typedef struct {
72 UINT_T Type; //Partition Type
73 UINT_T Usage; //Partition Usage
74 UINT_T Indentifier; //Partition ID
75 PartAttributes_T Attributes; //Attributes for this partition
76 UINT_T StartAddr; //Absolute address of start of partition
77 UINT_T Reserved1; //for now, the upper 32bits of 64bit address are reserved
78 UINT_T EndAddr; //Absolute address of end of partition
79 UINT_T Reserved2; //for now, the upper 32bits of 64bit address are reserved
80 UINT_T ReserveStartAddr; //Absolute address of start of reserved pool
81 UINT_T Reserved3; //for now, the upper 32bits of 64bit address are reserved
82 UINT_T ReserveSize; //Size of the reserved pool
83 UINT_T Reserved4; //for now, the upper 32bits of 64bit address are reserved
84 UINT_T ReserveAlgorithm; //Reserved pool algorithm
85 BBT_TYPE BBT_Type; //runtime BBT type
86 UINT_T RBBT_Location; //Absolute address of runtime BBT
87 UINT_T Reserved5; //for now, the upper 32bits of 64bit address are reserved
88 UINT_T BackupRBBT_Location;//Absoulte address of backup runtime BBT
89 UINT_T Reserved6; //for now, the upper 32bits of 64bit address are reserved
90 UINT_T Reserved[2];
91} PartitionInfo_T, *P_PartitionInfo_T;
92
93typedef struct
94{
95 union
96 {
97 UINT64 Identifier; //Partiton Table ID
98 struct
99 {
100 UINT_T Identifier0; // low half - for easier code access
101 UINT_T Identifier1; // hi half
102 };
103 };
104
105 UINT_T Version; //Partition Version
106 UINT_T NumPartitions; //Number of partitions
107 UINT_T Reserved[2];
108} PartitionTable_T, *P_PartitionTable_T;
109
110
111#endif
112
113