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