xref: /linux/include/uapi/linux/cycx_cfm.h (revision 607ca46e97a1b6594b29647d98a32d545c24bdff)
1*607ca46eSDavid Howells /*
2*607ca46eSDavid Howells * cycx_cfm.h	Cyclom 2X WAN Link Driver.
3*607ca46eSDavid Howells *		Definitions for the Cyclom 2X Firmware Module (CFM).
4*607ca46eSDavid Howells *
5*607ca46eSDavid Howells * Author:	Arnaldo Carvalho de Melo <acme@conectiva.com.br>
6*607ca46eSDavid Howells *
7*607ca46eSDavid Howells * Copyright:	(c) 1998-2003 Arnaldo Carvalho de Melo
8*607ca46eSDavid Howells *
9*607ca46eSDavid Howells * Based on sdlasfm.h by Gene Kozin <74604.152@compuserve.com>
10*607ca46eSDavid Howells *
11*607ca46eSDavid Howells *		This program is free software; you can redistribute it and/or
12*607ca46eSDavid Howells *		modify it under the terms of the GNU General Public License
13*607ca46eSDavid Howells *		as published by the Free Software Foundation; either version
14*607ca46eSDavid Howells *		2 of the License, or (at your option) any later version.
15*607ca46eSDavid Howells * ============================================================================
16*607ca46eSDavid Howells * 1998/08/08	acme		Initial version.
17*607ca46eSDavid Howells */
18*607ca46eSDavid Howells #ifndef	_CYCX_CFM_H
19*607ca46eSDavid Howells #define	_CYCX_CFM_H
20*607ca46eSDavid Howells 
21*607ca46eSDavid Howells /* Defines */
22*607ca46eSDavid Howells 
23*607ca46eSDavid Howells #define	CFM_VERSION	2
24*607ca46eSDavid Howells #define	CFM_SIGNATURE	"CFM - Cyclades CYCX Firmware Module"
25*607ca46eSDavid Howells 
26*607ca46eSDavid Howells /* min/max */
27*607ca46eSDavid Howells #define	CFM_IMAGE_SIZE	0x20000	/* max size of CYCX code image file */
28*607ca46eSDavid Howells #define	CFM_DESCR_LEN	256	/* max length of description string */
29*607ca46eSDavid Howells #define	CFM_MAX_CYCX	1	/* max number of compatible adapters */
30*607ca46eSDavid Howells #define	CFM_LOAD_BUFSZ	0x400	/* buffer size for reset code (buffer_load) */
31*607ca46eSDavid Howells 
32*607ca46eSDavid Howells /* Firmware Commands */
33*607ca46eSDavid Howells #define GEN_POWER_ON	0x1280
34*607ca46eSDavid Howells 
35*607ca46eSDavid Howells #define GEN_SET_SEG	0x1401	/* boot segment setting. */
36*607ca46eSDavid Howells #define GEN_BOOT_DAT	0x1402	/* boot data. */
37*607ca46eSDavid Howells #define GEN_START	0x1403	/* board start. */
38*607ca46eSDavid Howells #define GEN_DEFPAR	0x1404	/* buffer length for boot. */
39*607ca46eSDavid Howells 
40*607ca46eSDavid Howells /* Adapter Types */
41*607ca46eSDavid Howells #define CYCX_2X		2
42*607ca46eSDavid Howells /* for now only the 2X is supported, no plans to support 8X or 16X */
43*607ca46eSDavid Howells #define CYCX_8X		8
44*607ca46eSDavid Howells #define CYCX_16X	16
45*607ca46eSDavid Howells 
46*607ca46eSDavid Howells #define	CFID_X25_2X	5200
47*607ca46eSDavid Howells 
48*607ca46eSDavid Howells /**
49*607ca46eSDavid Howells  *	struct cycx_fw_info - firmware module information.
50*607ca46eSDavid Howells  *	@codeid - firmware ID
51*607ca46eSDavid Howells  *	@version - firmware version number
52*607ca46eSDavid Howells  *	@adapter - compatible adapter types
53*607ca46eSDavid Howells  *	@memsize - minimum memory size
54*607ca46eSDavid Howells  *	@reserved - reserved
55*607ca46eSDavid Howells  *	@startoffs - entry point offset
56*607ca46eSDavid Howells  *	@winoffs - dual-port memory window offset
57*607ca46eSDavid Howells  *	@codeoffs - code load offset
58*607ca46eSDavid Howells  *	@codesize - code size
59*607ca46eSDavid Howells  *	@dataoffs - configuration data load offset
60*607ca46eSDavid Howells  *	@datasize - configuration data size
61*607ca46eSDavid Howells  */
62*607ca46eSDavid Howells struct cycx_fw_info {
63*607ca46eSDavid Howells 	unsigned short	codeid;
64*607ca46eSDavid Howells 	unsigned short	version;
65*607ca46eSDavid Howells 	unsigned short	adapter[CFM_MAX_CYCX];
66*607ca46eSDavid Howells 	unsigned long	memsize;
67*607ca46eSDavid Howells 	unsigned short	reserved[2];
68*607ca46eSDavid Howells 	unsigned short	startoffs;
69*607ca46eSDavid Howells 	unsigned short	winoffs;
70*607ca46eSDavid Howells 	unsigned short	codeoffs;
71*607ca46eSDavid Howells 	unsigned long	codesize;
72*607ca46eSDavid Howells 	unsigned short	dataoffs;
73*607ca46eSDavid Howells 	unsigned long	datasize;
74*607ca46eSDavid Howells };
75*607ca46eSDavid Howells 
76*607ca46eSDavid Howells /**
77*607ca46eSDavid Howells  *	struct cycx_firmware - CYCX firmware file structure
78*607ca46eSDavid Howells  *	@signature - CFM file signature
79*607ca46eSDavid Howells  *	@version - file format version
80*607ca46eSDavid Howells  *	@checksum - info + image
81*607ca46eSDavid Howells  *	@reserved - reserved
82*607ca46eSDavid Howells  *	@descr - description string
83*607ca46eSDavid Howells  *	@info - firmware module info
84*607ca46eSDavid Howells  *	@image - code image (variable size)
85*607ca46eSDavid Howells  */
86*607ca46eSDavid Howells struct cycx_firmware {
87*607ca46eSDavid Howells 	char		    signature[80];
88*607ca46eSDavid Howells 	unsigned short	    version;
89*607ca46eSDavid Howells 	unsigned short	    checksum;
90*607ca46eSDavid Howells 	unsigned short	    reserved[6];
91*607ca46eSDavid Howells 	char		    descr[CFM_DESCR_LEN];
92*607ca46eSDavid Howells 	struct cycx_fw_info info;
93*607ca46eSDavid Howells 	unsigned char	    image[0];
94*607ca46eSDavid Howells };
95*607ca46eSDavid Howells 
96*607ca46eSDavid Howells struct cycx_fw_header {
97*607ca46eSDavid Howells 	unsigned long  reset_size;
98*607ca46eSDavid Howells 	unsigned long  data_size;
99*607ca46eSDavid Howells 	unsigned long  code_size;
100*607ca46eSDavid Howells };
101*607ca46eSDavid Howells #endif	/* _CYCX_CFM_H */
102