blob: f63f5fa59d7ef12b3605358697c9c672a0cbc8d8 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/* $Id: hysdn_pof.h,v 1.2.6.1 2001/09/23 22:24:54 kai Exp $
2 *
3 * Linux driver for HYSDN cards, definitions used for handling pof-files.
4 *
5 * Author Werner Cornelius (werner@titro.de) for Hypercope GmbH
6 * Copyright 1999 by Werner Cornelius (werner@titro.de)
7 *
8 * This software may be used and distributed according to the terms
9 * of the GNU General Public License, incorporated herein by reference.
10 *
11 */
12
13/************************/
14/* POF specific defines */
15/************************/
16#define BOOT_BUF_SIZE 0x1000 /* =4096, maybe moved to other h file */
17#define CRYPT_FEEDTERM 0x8142
18#define CRYPT_STARTTERM 0x81a5
Joe Perches475be4d2012-02-19 19:52:38 -080019/* max. timeout time in seconds
20 * from end of booting to POF is ready
21 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070022#define POF_READY_TIME_OUT_SEC 10
23
24/**********************************/
25/* defines for 1.stage boot image */
26/**********************************/
27
28/* the POF file record containing the boot loader image
29 * has 2 pages a 16KB:
30 * 1. page contains the high 16-bit part of the 32-bit E1 words
31 * 2. page contains the low 16-bit part of the 32-bit E1 words
32 *
33 * In each 16KB page we assume the start of the boot loader code
34 * in the highest 2KB part (at offset 0x3800);
35 * the rest (0x0000..0x37FF) is assumed to contain 0 bytes.
36 */
37
38#define POF_BOOT_LOADER_PAGE_SIZE 0x4000 /* =16384U */
Joe Perches475be4d2012-02-19 19:52:38 -080039#define POF_BOOT_LOADER_TOTAL_SIZE (2U * POF_BOOT_LOADER_PAGE_SIZE)
Linus Torvalds1da177e2005-04-16 15:20:36 -070040
41#define POF_BOOT_LOADER_CODE_SIZE 0x0800 /* =2KB =2048U */
42
Joe Perches475be4d2012-02-19 19:52:38 -080043/* offset in boot page, where loader code may start */
44/* =0x3800= 14336U */
Linus Torvalds1da177e2005-04-16 15:20:36 -070045#define POF_BOOT_LOADER_OFF_IN_PAGE (POF_BOOT_LOADER_PAGE_SIZE-POF_BOOT_LOADER_CODE_SIZE)
46
47
48/*--------------------------------------POF file record structs------------*/
49typedef struct PofFileHdr_tag { /* Pof file header */
Joe Perches475be4d2012-02-19 19:52:38 -080050 /*00 */ unsigned long Magic __attribute__((packed));
51 /*04 */ unsigned long N_PofRecs __attribute__((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -070052/*08 */
53} tPofFileHdr;
54
55typedef struct PofRecHdr_tag { /* Pof record header */
Joe Perches475be4d2012-02-19 19:52:38 -080056 /*00 */ unsigned short PofRecId __attribute__((packed));
57 /*02 */ unsigned long PofRecDataLen __attribute__((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -070058/*06 */
59} tPofRecHdr;
60
61typedef struct PofTimeStamp_tag {
Joe Perches475be4d2012-02-19 19:52:38 -080062 /*00 */ unsigned long UnixTime __attribute__((packed));
David Howellsa7403e82008-07-30 16:48:05 -070063 /*04 */ unsigned char DateTimeText[0x28];
Linus Torvalds1da177e2005-04-16 15:20:36 -070064 /* =40 */
65/*2C */
66} tPofTimeStamp;
67
Joe Perches475be4d2012-02-19 19:52:38 -080068/* tPofFileHdr.Magic value: */
Linus Torvalds1da177e2005-04-16 15:20:36 -070069#define TAGFILEMAGIC 0x464F501AUL
Joe Perches475be4d2012-02-19 19:52:38 -080070/* tPofRecHdr.PofRecId values: */
Linus Torvalds1da177e2005-04-16 15:20:36 -070071#define TAG_ABSDATA 0x1000 /* abs. data */
72#define TAG_BOOTDTA 0x1001 /* boot data */
73#define TAG_COMMENT 0x0020
74#define TAG_SYSCALL 0x0021
75#define TAG_FLOWCTRL 0x0022
76#define TAG_TIMESTMP 0x0010 /* date/time stamp of version */
77#define TAG_CABSDATA 0x1100 /* crypted abs. data */
78#define TAG_CBOOTDTA 0x1101 /* crypted boot data */