brintos

brintos / linux-shallow public Read only

0
0
Text · 3.6 KiB · 7edb809 Raw
104 lines · c
1/* SPDX-License-Identifier: GPL-2.0 */2#ifndef __LINUX_BCM963XX_TAG_H__3#define __LINUX_BCM963XX_TAG_H__4 5#include <linux/types.h>6 7#define TAGVER_LEN		4	/* Length of Tag Version */8#define TAGLAYOUT_LEN		4	/* Length of FlashLayoutVer */9#define SIG1_LEN		20	/* Company Signature 1 Length */10#define SIG2_LEN		14	/* Company Signature 2 Length */11#define BOARDID_LEN		16	/* Length of BoardId */12#define ENDIANFLAG_LEN		2	/* Endian Flag Length */13#define CHIPID_LEN		6	/* Chip Id Length */14#define IMAGE_LEN		10	/* Length of Length Field */15#define ADDRESS_LEN		12	/* Length of Address field */16#define IMAGE_SEQUENCE_LEN	4	/* Image sequence 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		224#define IMAGETAG_CRC_START	0xFFFFFFFF25 26#define PIRELLI_BOARDS { \27	"AGPF-S0", \28	"DWV-S0", \29}30 31/* Extended flash address, needs to be subtracted32 * from bcm_tag flash image offsets.33 */34#define BCM963XX_EXTENDED_SIZE	0xBFC0000035 36/*37 * The broadcom firmware assumes the rootfs starts the image,38 * therefore uses the rootfs start (flash_image_address)39 * to determine where to flash the image.  Since we have the kernel first40 * we have to give it the kernel address, but the crc uses the length41 * associated with this address (root_length), which is added to the kernel42 * length (kernel_length) to determine the length of image to flash and thus43 * needs to be rootfs + deadcode (jffs2 EOF marker)44*/45 46struct bcm_tag {47	/* 0-3: Version of the image tag */48	char tag_version[TAGVER_LEN];49	/* 4-23: Company Line 1 */50	char sig_1[SIG1_LEN];51	/*  24-37: Company Line 2 */52	char sig_2[SIG2_LEN];53	/* 38-43: Chip this image is for */54	char chip_id[CHIPID_LEN];55	/* 44-59: Board name */56	char board_id[BOARDID_LEN];57	/* 60-61: Map endianness -- 1 BE 0 LE */58	char big_endian[ENDIANFLAG_LEN];59	/* 62-71: Total length of image */60	char total_length[IMAGE_LEN];61	/* 72-83: Address in memory of CFE */62	char cfe__address[ADDRESS_LEN];63	/* 84-93: Size of CFE */64	char cfe_length[IMAGE_LEN];65	/* 94-105: Address in memory of image start66	 * (kernel for OpenWRT, rootfs for stock firmware)67	 */68	char flash_image_start[ADDRESS_LEN];69	/* 106-115: Size of rootfs */70	char root_length[IMAGE_LEN];71	/* 116-127: Address in memory of kernel */72	char kernel_address[ADDRESS_LEN];73	/* 128-137: Size of kernel */74	char kernel_length[IMAGE_LEN];75	/* 138-141: Image sequence number76	 * (to be incremented when flashed with a new image)77	 */78	char image_sequence[IMAGE_SEQUENCE_LEN];79	/* 142-161: RSA Signature (not used; some vendors may use this) */80	char rsa_signature[RSASIG_LEN];81	/* 162-191: Compilation and related information (not used in OpenWrt) */82	char information1[TAGINFO1_LEN];83	/* 192-195: Version flash layout */84	char flash_layout_ver[FLASHLAYOUTVER_LEN];85	/* 196-199: kernel+rootfs CRC32 */86	__u32 fskernel_crc;87	/* 200-215: Unused except on Alice Gate where it is information */88	char information2[TAGINFO2_LEN];89	/* 216-219: CRC32 of image less imagetag (kernel for Alice Gate) */90	__u32 image_crc;91	/* 220-223: CRC32 of rootfs partition */92	__u32 rootfs_crc;93	/* 224-227: CRC32 of kernel partition */94	__u32 kernel_crc;95	/* 228-235: Unused at present */96	char reserved1[8];97	/* 236-239: CRC32 of header excluding last 20 bytes */98	__u32 header_crc;99	/* 240-255: Unused at present */100	char reserved2[16];101};102 103#endif /* __LINUX_BCM63XX_TAG_H__ */104