![]() |
|
|||
0001 /* SPDX-License-Identifier: GPL-2.0 */ 0002 #ifndef __LINUX_BCM963XX_TAG_H__ 0003 #define __LINUX_BCM963XX_TAG_H__ 0004 0005 #include <linux/types.h> 0006 0007 #define TAGVER_LEN 4 /* Length of Tag Version */ 0008 #define TAGLAYOUT_LEN 4 /* Length of FlashLayoutVer */ 0009 #define SIG1_LEN 20 /* Company Signature 1 Length */ 0010 #define SIG2_LEN 14 /* Company Signature 2 Length */ 0011 #define BOARDID_LEN 16 /* Length of BoardId */ 0012 #define ENDIANFLAG_LEN 2 /* Endian Flag Length */ 0013 #define CHIPID_LEN 6 /* Chip Id Length */ 0014 #define IMAGE_LEN 10 /* Length of Length Field */ 0015 #define ADDRESS_LEN 12 /* Length of Address field */ 0016 #define IMAGE_SEQUENCE_LEN 4 /* Image sequence Length */ 0017 #define RSASIG_LEN 20 /* Length of RSA Signature in tag */ 0018 #define TAGINFO1_LEN 30 /* Length of vendor information field1 in tag */ 0019 #define FLASHLAYOUTVER_LEN 4 /* Length of Flash Layout Version String tag */ 0020 #define TAGINFO2_LEN 16 /* Length of vendor information field2 in tag */ 0021 #define ALTTAGINFO_LEN 54 /* Alternate length for vendor information; Pirelli */ 0022 0023 #define NUM_PIRELLI 2 0024 #define IMAGETAG_CRC_START 0xFFFFFFFF 0025 0026 #define PIRELLI_BOARDS { \ 0027 "AGPF-S0", \ 0028 "DWV-S0", \ 0029 } 0030 0031 /* Extended flash address, needs to be subtracted 0032 * from bcm_tag flash image offsets. 0033 */ 0034 #define BCM963XX_EXTENDED_SIZE 0xBFC00000 0035 0036 /* 0037 * The broadcom firmware assumes the rootfs starts the image, 0038 * therefore uses the rootfs start (flash_image_address) 0039 * to determine where to flash the image. Since we have the kernel first 0040 * we have to give it the kernel address, but the crc uses the length 0041 * associated with this address (root_length), which is added to the kernel 0042 * length (kernel_length) to determine the length of image to flash and thus 0043 * needs to be rootfs + deadcode (jffs2 EOF marker) 0044 */ 0045 0046 struct bcm_tag { 0047 /* 0-3: Version of the image tag */ 0048 char tag_version[TAGVER_LEN]; 0049 /* 4-23: Company Line 1 */ 0050 char sig_1[SIG1_LEN]; 0051 /* 24-37: Company Line 2 */ 0052 char sig_2[SIG2_LEN]; 0053 /* 38-43: Chip this image is for */ 0054 char chip_id[CHIPID_LEN]; 0055 /* 44-59: Board name */ 0056 char board_id[BOARDID_LEN]; 0057 /* 60-61: Map endianness -- 1 BE 0 LE */ 0058 char big_endian[ENDIANFLAG_LEN]; 0059 /* 62-71: Total length of image */ 0060 char total_length[IMAGE_LEN]; 0061 /* 72-83: Address in memory of CFE */ 0062 char cfe__address[ADDRESS_LEN]; 0063 /* 84-93: Size of CFE */ 0064 char cfe_length[IMAGE_LEN]; 0065 /* 94-105: Address in memory of image start 0066 * (kernel for OpenWRT, rootfs for stock firmware) 0067 */ 0068 char flash_image_start[ADDRESS_LEN]; 0069 /* 106-115: Size of rootfs */ 0070 char root_length[IMAGE_LEN]; 0071 /* 116-127: Address in memory of kernel */ 0072 char kernel_address[ADDRESS_LEN]; 0073 /* 128-137: Size of kernel */ 0074 char kernel_length[IMAGE_LEN]; 0075 /* 138-141: Image sequence number 0076 * (to be incremented when flashed with a new image) 0077 */ 0078 char image_sequence[IMAGE_SEQUENCE_LEN]; 0079 /* 142-161: RSA Signature (not used; some vendors may use this) */ 0080 char rsa_signature[RSASIG_LEN]; 0081 /* 162-191: Compilation and related information (not used in OpenWrt) */ 0082 char information1[TAGINFO1_LEN]; 0083 /* 192-195: Version flash layout */ 0084 char flash_layout_ver[FLASHLAYOUTVER_LEN]; 0085 /* 196-199: kernel+rootfs CRC32 */ 0086 __u32 fskernel_crc; 0087 /* 200-215: Unused except on Alice Gate where it is information */ 0088 char information2[TAGINFO2_LEN]; 0089 /* 216-219: CRC32 of image less imagetag (kernel for Alice Gate) */ 0090 __u32 image_crc; 0091 /* 220-223: CRC32 of rootfs partition */ 0092 __u32 rootfs_crc; 0093 /* 224-227: CRC32 of kernel partition */ 0094 __u32 kernel_crc; 0095 /* 228-235: Unused at present */ 0096 char reserved1[8]; 0097 /* 236-239: CRC32 of header excluding last 20 bytes */ 0098 __u32 header_crc; 0099 /* 240-255: Unused at present */ 0100 char reserved2[16]; 0101 }; 0102 0103 #endif /* __LINUX_BCM63XX_TAG_H__ */
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.1.0 LXR engine. The LXR team |
![]() ![]() |