[PATCH 10/47] Merge axisflashmap.h with Axis internal changes.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jesper Nilsson
Date: Thursday, November 29, 2007 - 9:58 am

- 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.

Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
---
 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 7a8d311..015ca54 100644
--- a/include/asm-cris/axisflashmap.h
+++ b/include/asm-cris/axisflashmap.h
@@ -10,23 +10,23 @@
  */
 
 #define PARTITION_TABLE_OFFSET 10
-#define PARTITION_TABLE_MAGIC 0xbeef /* Not a good magic */
+#define PARTITION_TABLE_MAGIC 0xbeef	/* Not a good magic */
 
 /* The partitiontable_head is located at offset +10: */
 struct partitiontable_head {
-	__u16 magic; /* PARTITION_TABLE_MAGIC */ 
-	__u16 size;  /* Length of ptable block (not header) */
-	__u32 checksum; /* simple longword sum */
+	__u16 magic;	/* PARTITION_TABLE_MAGIC */
+	__u16 size;	/* Length of ptable block (entries + end marker) */
+	__u32 checksum;	/* simple longword sum, over entries + end marker  */
 };
 
 /* And followed by partition table entries */
 struct partitiontable_entry {
-	__u32 offset;   /* Offset is relative to the sector the ptable is in */
-	__u32 size;
-	__u32 checksum; /* simple longword sum */
-	__u16 type;
-	__u16 flags;   /* bit 0: ro/rw = 1/0 */
-	__u32 future0; /* 16 bytes reserved for future use */
+	__u32 offset;		/* relative to the sector the ptable is in */
+	__u32 size;		/* in bytes */
+	__u32 checksum;		/* simple longword sum */
+	__u16 type;		/* see type codes below */
+	__u16 flags;		/* bit 0: ro/rw = 1/0 */
+	__u32 future0;		/* 16 bytes reserved for future use */
 	__u32 future1;
 	__u32 future2;
 	__u32 future3;
@@ -35,12 +35,27 @@ struct partitiontable_entry {
 #define PARTITIONTABLE_END_MARKER 0xFFFFFFFF
 #define PARTITIONTABLE_END_MARKER_SIZE 4
 
-/*#define PARTITION_TYPE_RESCUE 0x0000?*/  /* Not used, maybe it should? */
+#define PARTITIONTABLE_END_PAD	10
+
+/* Complete structure for whole partition table */
+/* note that table may end before CONFIG_ETRAX_PTABLE_ENTRIES by setting
+ * offset of the last entry + 1 to PARTITIONTABLE_END_MARKER.
+ */
+struct partitiontable {
+	__u8 skip[PARTITION_TABLE_OFFSET];
+	struct partitiontable_head head;
+	struct partitiontable_entry entries[];
+};
+
 #define PARTITION_TYPE_PARAM  0x0001
 #define PARTITION_TYPE_KERNEL 0x0002
 #define PARTITION_TYPE_JFFS   0x0003
+#define PARTITION_TYPE_JFFS2  0x0000
+
+#define	PARTITION_FLAGS_READONLY_MASK	0x0001
+#define	PARTITION_FLAGS_READONLY	0x0001
 
 /* The master mtd for the entire flash. */
-extern struct mtd_info* axisflash_mtd;
+extern struct mtd_info *axisflash_mtd;
 
 #endif
-- 
1.5.3.6.970.gd25430

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 02/47] Add new driver files for Artpec-3., Jesper Nilsson, (Thu Nov 29, 9:03 am)
[PATCH 03/47] Add new driver files for Etrax-FS, Jesper Nilsson, (Thu Nov 29, 9:05 am)
[PATCH 06/47] Add serial driver for CRISv32., Jesper Nilsson, (Thu Nov 29, 9:23 am)
[PATCH 07/47] Add L2 cache initialization code., Jesper Nilsson, (Thu Nov 29, 9:24 am)
[PATCH 09/47] Update CRISv32 synchronous serial driver., Jesper Nilsson, (Thu Nov 29, 9:30 am)
[PATCH 10/47] Merge axisflashmap.h with Axis internal changes., Jesper Nilsson, (Thu Nov 29, 9:58 am)
[PATCH 11/47] Minor fixes to CRISv32 irq defines., Jesper Nilsson, (Thu Nov 29, 10:11 am)
[PATCH 12/47] Remove unnecessary CVS log from cris/mm/init.c, Jesper Nilsson, (Thu Nov 29, 10:19 am)
[PATCH 13/47] Add prototypes for cache flushing on CRISv32, Jesper Nilsson, (Fri Nov 30, 2:11 am)
[PATCH 15/47] Minor fixes to mm/fault.c for CRIS., Jesper Nilsson, (Fri Nov 30, 5:59 am)
[PATCH 16/47] Minor CRIS generic kernel/traps.c changes., Jesper Nilsson, (Fri Nov 30, 6:11 am)
[PATCH 19/47] Update CRISv32 entry.S to working order., Jesper Nilsson, (Fri Nov 30, 7:44 am)
[PATCH 20/47] Fixup CRISv32 kernel Makefile., Jesper Nilsson, (Fri Nov 30, 7:47 am)
[PATCH 21/47] New version of CRISv32 I2C driver., Jesper Nilsson, (Fri Nov 30, 7:54 am)
[PATCH 22/47] Update and improve axisflashmap for CRISv32., Jesper Nilsson, (Fri Nov 30, 8:01 am)
[PATCH 23/47] Update CRIS main Kbuild makefile., Jesper Nilsson, (Fri Nov 30, 8:07 am)
[PATCH 26/47] Update CRISv10 rescue Kbuild makefile., Jesper Nilsson, (Fri Nov 30, 8:11 am)
[PATCH 27/47] Update CRISv10 rescue head.s, Jesper Nilsson, (Fri Nov 30, 8:13 am)
[PATCH 28/47] Update and improve CRISv10 axisflashmap.c, Jesper Nilsson, (Fri Nov 30, 8:17 am)
[PATCH 29/47] Update CRISv32 traps.c, Jesper Nilsson, (Fri Nov 30, 8:22 am)
[PATCH 30/47] Update CRISv32 boot Kbuild makefile., Jesper Nilsson, (Fri Nov 30, 8:24 am)
[PATCH 32/47] Update CRISv32 boot rescue Kbuild makefile., Jesper Nilsson, (Fri Nov 30, 8:28 am)
[PATCH 34/47] Update CRISv32 compressed head.S, Jesper Nilsson, (Fri Nov 30, 8:40 am)
[PATCH 35/47] Update CRISv32 boot/compressed/misc.c, Jesper Nilsson, (Fri Nov 30, 9:16 am)
[PATCH 36/47] Update CRISv32 boot/rescue/head.S code., Jesper Nilsson, (Fri Nov 30, 9:20 am)
[PATCH 37/47] Update CRISv32 debugport., Jesper Nilsson, (Fri Nov 30, 9:26 am)
[PATCH 38/47] Include path fix for CRISv32 timex.h, Jesper Nilsson, (Fri Nov 30, 9:28 am)
[PATCH 40/47] Update CRISv32 kernel/head.S, Jesper Nilsson, (Fri Nov 30, 9:54 am)
[PATCH 41/47] Update and simplify CRISv32 kernel/irq.c., Jesper Nilsson, (Fri Nov 30, 10:09 am)
[PATCH] Remove rcu_assign_pointer() penalty for NULL pointers, Paul E. McKenney, (Fri Nov 30, 5:37 pm)
[PATCH 42/47] Minor updates to CRISv32 kernel/process.c, Jesper Nilsson, (Mon Dec 3, 2:54 am)
[PATCH 43/47] Update and improve CRISv32 kernel/traps.c, Jesper Nilsson, (Mon Dec 3, 3:12 am)
[PATCH 44/47] Minor fixes for CRISv32 io.h, Jesper Nilsson, (Mon Dec 3, 3:16 am)
[PATCH 45/47] New default config for CRISv10., Jesper Nilsson, (Mon Dec 3, 3:37 am)
Re: [PATCH 27/47] Update CRISv10 rescue head.s, Jesper Nilsson, (Thu Dec 6, 5:46 pm)
Re: [PATCH 06/47] Add serial driver for CRISv32., Andrew Morton, (Wed Dec 12, 4:14 am)
Re: [PATCH 15/47] Minor fixes to mm/fault.c for CRIS., Andrew Morton, (Wed Dec 12, 4:17 am)
Re: [PATCH 21/47] New version of CRISv32 I2C driver., Andrew Morton, (Wed Dec 12, 4:19 am)
Re: [PATCH 29/47] Update CRISv32 traps.c, Andrew Morton, (Wed Dec 12, 4:21 am)
Re: [PATCH 39/47] Update and improve CRISv32 fasttimer.c, Andrew Morton, (Wed Dec 12, 4:23 am)
Re: [PATCH 44/47] Minor fixes for CRISv32 io.h, Andrew Morton, (Wed Dec 12, 4:29 am)
Re: [PATCH 15/47] Minor fixes to mm/fault.c for CRIS., Jesper Nilsson, (Wed Dec 12, 6:36 am)
Re: [PATCH 44/47] Minor fixes for CRISv32 io.h, Jesper Nilsson, (Wed Dec 12, 10:04 am)