diff options
author | Jesper Nilsson <jesper.nilsson@axis.com> | 2007-11-29 11:58:06 -0500 |
---|---|---|
committer | Jesper Nilsson <jesper.nilsson@axis.com> | 2008-02-08 05:06:24 -0500 |
commit | 0c2efc4848984ed38753d48990f0f0c72af56ba9 (patch) | |
tree | 44616bd1241c33cb4d32e43c92a6ebb2205cd596 /include/asm-cris | |
parent | e908dfc3c08d684b115f6fbd3740c6b77e0ddaf8 (diff) |
CRIS: Merge axisflashmap.h with Axis internal changes.
- Add partition table struct to be used to parse partition table in flash.
- Add JFFS2 as a type, and add readoly flag.
- Improve some comments.
- Lindent has been run, fixing whitespace and formatting issues.
Diffstat (limited to 'include/asm-cris')
-rw-r--r-- | include/asm-cris/axisflashmap.h | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/include/asm-cris/axisflashmap.h b/include/asm-cris/axisflashmap.h index 7a8d3114e682..015ca5445ddd 100644 --- a/include/asm-cris/axisflashmap.h +++ b/include/asm-cris/axisflashmap.h | |||
@@ -10,23 +10,23 @@ | |||
10 | */ | 10 | */ |
11 | 11 | ||
12 | #define PARTITION_TABLE_OFFSET 10 | 12 | #define PARTITION_TABLE_OFFSET 10 |
13 | #define PARTITION_TABLE_MAGIC 0xbeef /* Not a good magic */ | 13 | #define PARTITION_TABLE_MAGIC 0xbeef /* Not a good magic */ |
14 | 14 | ||
15 | /* The partitiontable_head is located at offset +10: */ | 15 | /* The partitiontable_head is located at offset +10: */ |
16 | struct partitiontable_head { | 16 | struct partitiontable_head { |
17 | __u16 magic; /* PARTITION_TABLE_MAGIC */ | 17 | __u16 magic; /* PARTITION_TABLE_MAGIC */ |
18 | __u16 size; /* Length of ptable block (not header) */ | 18 | __u16 size; /* Length of ptable block (entries + end marker) */ |
19 | __u32 checksum; /* simple longword sum */ | 19 | __u32 checksum; /* simple longword sum, over entries + end marker */ |
20 | }; | 20 | }; |
21 | 21 | ||
22 | /* And followed by partition table entries */ | 22 | /* And followed by partition table entries */ |
23 | struct partitiontable_entry { | 23 | struct partitiontable_entry { |
24 | __u32 offset; /* Offset is relative to the sector the ptable is in */ | 24 | __u32 offset; /* relative to the sector the ptable is in */ |
25 | __u32 size; | 25 | __u32 size; /* in bytes */ |
26 | __u32 checksum; /* simple longword sum */ | 26 | __u32 checksum; /* simple longword sum */ |
27 | __u16 type; | 27 | __u16 type; /* see type codes below */ |
28 | __u16 flags; /* bit 0: ro/rw = 1/0 */ | 28 | __u16 flags; /* bit 0: ro/rw = 1/0 */ |
29 | __u32 future0; /* 16 bytes reserved for future use */ | 29 | __u32 future0; /* 16 bytes reserved for future use */ |
30 | __u32 future1; | 30 | __u32 future1; |
31 | __u32 future2; | 31 | __u32 future2; |
32 | __u32 future3; | 32 | __u32 future3; |
@@ -35,12 +35,27 @@ struct partitiontable_entry { | |||
35 | #define PARTITIONTABLE_END_MARKER 0xFFFFFFFF | 35 | #define PARTITIONTABLE_END_MARKER 0xFFFFFFFF |
36 | #define PARTITIONTABLE_END_MARKER_SIZE 4 | 36 | #define PARTITIONTABLE_END_MARKER_SIZE 4 |
37 | 37 | ||
38 | /*#define PARTITION_TYPE_RESCUE 0x0000?*/ /* Not used, maybe it should? */ | 38 | #define PARTITIONTABLE_END_PAD 10 |
39 | |||
40 | /* Complete structure for whole partition table */ | ||
41 | /* note that table may end before CONFIG_ETRAX_PTABLE_ENTRIES by setting | ||
42 | * offset of the last entry + 1 to PARTITIONTABLE_END_MARKER. | ||
43 | */ | ||
44 | struct partitiontable { | ||
45 | __u8 skip[PARTITION_TABLE_OFFSET]; | ||
46 | struct partitiontable_head head; | ||
47 | struct partitiontable_entry entries[]; | ||
48 | }; | ||
49 | |||
39 | #define PARTITION_TYPE_PARAM 0x0001 | 50 | #define PARTITION_TYPE_PARAM 0x0001 |
40 | #define PARTITION_TYPE_KERNEL 0x0002 | 51 | #define PARTITION_TYPE_KERNEL 0x0002 |
41 | #define PARTITION_TYPE_JFFS 0x0003 | 52 | #define PARTITION_TYPE_JFFS 0x0003 |
53 | #define PARTITION_TYPE_JFFS2 0x0000 | ||
54 | |||
55 | #define PARTITION_FLAGS_READONLY_MASK 0x0001 | ||
56 | #define PARTITION_FLAGS_READONLY 0x0001 | ||
42 | 57 | ||
43 | /* The master mtd for the entire flash. */ | 58 | /* The master mtd for the entire flash. */ |
44 | extern struct mtd_info* axisflash_mtd; | 59 | extern struct mtd_info *axisflash_mtd; |
45 | 60 | ||
46 | #endif | 61 | #endif |