/arch/mips/include/asm/mach-bcm63xx/bcm963xx_tag.h

http://github.com/mirrors/linux · C++ Header · 96 lines · 53 code · 6 blank · 37 comment · 0 complexity · 33182dc2fb0696341cb3e6f6cf466227 MD5 · raw file

  1. #ifndef __BCM963XX_TAG_H
  2. #define __BCM963XX_TAG_H
  3. #define TAGVER_LEN 4 /* Length of Tag Version */
  4. #define TAGLAYOUT_LEN 4 /* Length of FlashLayoutVer */
  5. #define SIG1_LEN 20 /* Company Signature 1 Length */
  6. #define SIG2_LEN 14 /* Company Signature 2 Length */
  7. #define BOARDID_LEN 16 /* Length of BoardId */
  8. #define ENDIANFLAG_LEN 2 /* Endian Flag Length */
  9. #define CHIPID_LEN 6 /* Chip Id Length */
  10. #define IMAGE_LEN 10 /* Length of Length Field */
  11. #define ADDRESS_LEN 12 /* Length of Address field */
  12. #define DUALFLAG_LEN 2 /* Dual Image flag Length */
  13. #define INACTIVEFLAG_LEN 2 /* Inactie Flag Length */
  14. #define RSASIG_LEN 20 /* Length of RSA Signature in tag */
  15. #define TAGINFO1_LEN 30 /* Length of vendor information field1 in tag */
  16. #define FLASHLAYOUTVER_LEN 4 /* Length of Flash Layout Version String tag */
  17. #define TAGINFO2_LEN 16 /* Length of vendor information field2 in tag */
  18. #define ALTTAGINFO_LEN 54 /* Alternate length for vendor information; Pirelli */
  19. #define NUM_PIRELLI 2
  20. #define IMAGETAG_CRC_START 0xFFFFFFFF
  21. #define PIRELLI_BOARDS { \
  22. "AGPF-S0", \
  23. "DWV-S0", \
  24. }
  25. /*
  26. * The broadcom firmware assumes the rootfs starts the image,
  27. * therefore uses the rootfs start (flash_image_address)
  28. * to determine where to flash the image. Since we have the kernel first
  29. * we have to give it the kernel address, but the crc uses the length
  30. * associated with this address (root_length), which is added to the kernel
  31. * length (kernel_length) to determine the length of image to flash and thus
  32. * needs to be rootfs + deadcode (jffs2 EOF marker)
  33. */
  34. struct bcm_tag {
  35. /* 0-3: Version of the image tag */
  36. char tag_version[TAGVER_LEN];
  37. /* 4-23: Company Line 1 */
  38. char sig_1[SIG1_LEN];
  39. /* 24-37: Company Line 2 */
  40. char sig_2[SIG2_LEN];
  41. /* 38-43: Chip this image is for */
  42. char chip_id[CHIPID_LEN];
  43. /* 44-59: Board name */
  44. char board_id[BOARDID_LEN];
  45. /* 60-61: Map endianness -- 1 BE 0 LE */
  46. char big_endian[ENDIANFLAG_LEN];
  47. /* 62-71: Total length of image */
  48. char total_length[IMAGE_LEN];
  49. /* 72-83: Address in memory of CFE */
  50. char cfe__address[ADDRESS_LEN];
  51. /* 84-93: Size of CFE */
  52. char cfe_length[IMAGE_LEN];
  53. /* 94-105: Address in memory of image start
  54. * (kernel for OpenWRT, rootfs for stock firmware)
  55. */
  56. char flash_image_start[ADDRESS_LEN];
  57. /* 106-115: Size of rootfs */
  58. char root_length[IMAGE_LEN];
  59. /* 116-127: Address in memory of kernel */
  60. char kernel_address[ADDRESS_LEN];
  61. /* 128-137: Size of kernel */
  62. char kernel_length[IMAGE_LEN];
  63. /* 138-139: Unused at the moment */
  64. char dual_image[DUALFLAG_LEN];
  65. /* 140-141: Unused at the moment */
  66. char inactive_flag[INACTIVEFLAG_LEN];
  67. /* 142-161: RSA Signature (not used; some vendors may use this) */
  68. char rsa_signature[RSASIG_LEN];
  69. /* 162-191: Compilation and related information (not used in OpenWrt) */
  70. char information1[TAGINFO1_LEN];
  71. /* 192-195: Version flash layout */
  72. char flash_layout_ver[FLASHLAYOUTVER_LEN];
  73. /* 196-199: kernel+rootfs CRC32 */
  74. __u32 fskernel_crc;
  75. /* 200-215: Unused except on Alice Gate where is is information */
  76. char information2[TAGINFO2_LEN];
  77. /* 216-219: CRC32 of image less imagetag (kernel for Alice Gate) */
  78. __u32 image_crc;
  79. /* 220-223: CRC32 of rootfs partition */
  80. __u32 rootfs_crc;
  81. /* 224-227: CRC32 of kernel partition */
  82. __u32 kernel_crc;
  83. /* 228-235: Unused at present */
  84. char reserved1[8];
  85. /* 236-239: CRC32 of header excluding last 20 bytes */
  86. __u32 header_crc;
  87. /* 240-255: Unused at present */
  88. char reserved2[16];
  89. };
  90. #endif /* __BCM63XX_TAG_H */