axisflashmap.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:2k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. #ifndef __ASM_AXISFLASHMAP_H
  2. #define __ASM_AXISFLASHMAP_H
  3. /* Bootblock parameters are stored at 0xc000 and has the FLASH_BOOT_MAGIC 
  4.  * as start, it ends with 0xFFFFFFFF */
  5. #define FLASH_BOOT_MAGIC 0xbeefcace
  6. #define BOOTPARAM_OFFSET 0xc000
  7. /* apps/bootblocktool is used to read and write the parameters,
  8.  * and it has nothing to do with the partition table. 
  9.  */
  10. /* the partitiontable consists of some "jump over" code, a head and
  11.  * then the actual entries.
  12.  * tools/mkptable is used to generate the ptable. 
  13.  */
  14. /* The partition table starts with code to "jump over" it.  The ba
  15.    instruction and delay-slot is modified elsewhere (for example the
  16.    mkptable script); don't change this to fill the delay-slot.  */
  17. #define PARTITIONTABLE_CODE_START { 
  18.  0x0f, 0x05, /* nop 0 */
  19.  0x25, 0xf0, /* di  2 */
  20.  0xed, 0xff  /* ba  4 */ }
  21. /* The actual offset depend on the number of entries */
  22. #define PARTITIONTABLE_CODE_END { 
  23.  0x00, 0x00, /* ba offset 6 */
  24.  0x0f, 0x05  /* nop 8 */}
  25. #define PARTITION_TABLE_OFFSET 10
  26. #define PARTITION_TABLE_MAGIC 0xbeef /* Not a good magic */
  27. /* The partitiontable_head is located at offset +10: */
  28. struct partitiontable_head {
  29. __u16 magic; /* PARTITION_TABLE_MAGIC */ 
  30. __u16 size;  /* Length of ptable block (not header) */
  31. __u32 checksum; /* simple longword sum */
  32. };
  33. /* And followed by partition table entries */
  34. struct partitiontable_entry {
  35. __u32 offset;   /* Offset is relative to the sector the ptable is in */
  36. __u32 size;
  37. __u32 checksum; /* simple longword sum */
  38. __u16 type;
  39. __u16 flags;   /* bit 0: ro/rw = 1/0 */
  40. __u32 future0; /* 16 bytes reserved for future use */
  41. __u32 future1;
  42. __u32 future2;
  43. __u32 future3;
  44. };
  45. /* ended by an end marker: */
  46. #define PARTITIONTABLE_END_MARKER 0xFFFFFFFF
  47. #define PARTITIONTABLE_END_MARKER_SIZE 4
  48. /*#define PARTITION_TYPE_RESCUE 0x0000?*/  /* Not used, maybe it should? */
  49. #define PARTITION_TYPE_PARAM  0x0001
  50. #define PARTITION_TYPE_KERNEL 0x0002
  51. #define PARTITION_TYPE_JFFS   0x0003
  52. #endif