xref: /linux/include/uapi/linux/cycx_cfm.h (revision 4f2c0a4acffbec01079c28f839422e64ddeff004)
1e2be04c7SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2607ca46eSDavid Howells /*
3607ca46eSDavid Howells * cycx_cfm.h	Cyclom 2X WAN Link Driver.
4607ca46eSDavid Howells *		Definitions for the Cyclom 2X Firmware Module (CFM).
5607ca46eSDavid Howells *
6607ca46eSDavid Howells * Author:	Arnaldo Carvalho de Melo <acme@conectiva.com.br>
7607ca46eSDavid Howells *
8607ca46eSDavid Howells * Copyright:	(c) 1998-2003 Arnaldo Carvalho de Melo
9607ca46eSDavid Howells *
10607ca46eSDavid Howells * Based on sdlasfm.h by Gene Kozin <74604.152@compuserve.com>
11607ca46eSDavid Howells *
12607ca46eSDavid Howells *		This program is free software; you can redistribute it and/or
13607ca46eSDavid Howells *		modify it under the terms of the GNU General Public License
14607ca46eSDavid Howells *		as published by the Free Software Foundation; either version
15607ca46eSDavid Howells *		2 of the License, or (at your option) any later version.
16607ca46eSDavid Howells * ============================================================================
17607ca46eSDavid Howells * 1998/08/08	acme		Initial version.
18607ca46eSDavid Howells */
19607ca46eSDavid Howells #ifndef	_CYCX_CFM_H
20607ca46eSDavid Howells #define	_CYCX_CFM_H
21607ca46eSDavid Howells 
22607ca46eSDavid Howells /* Defines */
23607ca46eSDavid Howells 
24607ca46eSDavid Howells #define	CFM_VERSION	2
25607ca46eSDavid Howells #define	CFM_SIGNATURE	"CFM - Cyclades CYCX Firmware Module"
26607ca46eSDavid Howells 
27607ca46eSDavid Howells /* min/max */
28607ca46eSDavid Howells #define	CFM_IMAGE_SIZE	0x20000	/* max size of CYCX code image file */
29607ca46eSDavid Howells #define	CFM_DESCR_LEN	256	/* max length of description string */
30607ca46eSDavid Howells #define	CFM_MAX_CYCX	1	/* max number of compatible adapters */
31607ca46eSDavid Howells #define	CFM_LOAD_BUFSZ	0x400	/* buffer size for reset code (buffer_load) */
32607ca46eSDavid Howells 
33607ca46eSDavid Howells /* Firmware Commands */
34607ca46eSDavid Howells #define GEN_POWER_ON	0x1280
35607ca46eSDavid Howells 
36607ca46eSDavid Howells #define GEN_SET_SEG	0x1401	/* boot segment setting. */
37607ca46eSDavid Howells #define GEN_BOOT_DAT	0x1402	/* boot data. */
38607ca46eSDavid Howells #define GEN_START	0x1403	/* board start. */
39607ca46eSDavid Howells #define GEN_DEFPAR	0x1404	/* buffer length for boot. */
40607ca46eSDavid Howells 
41607ca46eSDavid Howells /* Adapter Types */
42607ca46eSDavid Howells #define CYCX_2X		2
43607ca46eSDavid Howells /* for now only the 2X is supported, no plans to support 8X or 16X */
44607ca46eSDavid Howells #define CYCX_8X		8
45607ca46eSDavid Howells #define CYCX_16X	16
46607ca46eSDavid Howells 
47607ca46eSDavid Howells #define	CFID_X25_2X	5200
48607ca46eSDavid Howells 
49607ca46eSDavid Howells /**
50607ca46eSDavid Howells  *	struct cycx_fw_info - firmware module information.
51607ca46eSDavid Howells  *	@codeid - firmware ID
52607ca46eSDavid Howells  *	@version - firmware version number
53607ca46eSDavid Howells  *	@adapter - compatible adapter types
54607ca46eSDavid Howells  *	@memsize - minimum memory size
55607ca46eSDavid Howells  *	@reserved - reserved
56607ca46eSDavid Howells  *	@startoffs - entry point offset
57607ca46eSDavid Howells  *	@winoffs - dual-port memory window offset
58607ca46eSDavid Howells  *	@codeoffs - code load offset
59607ca46eSDavid Howells  *	@codesize - code size
60607ca46eSDavid Howells  *	@dataoffs - configuration data load offset
61607ca46eSDavid Howells  *	@datasize - configuration data size
62607ca46eSDavid Howells  */
63607ca46eSDavid Howells struct cycx_fw_info {
64607ca46eSDavid Howells 	unsigned short	codeid;
65607ca46eSDavid Howells 	unsigned short	version;
66607ca46eSDavid Howells 	unsigned short	adapter[CFM_MAX_CYCX];
67607ca46eSDavid Howells 	unsigned long	memsize;
68607ca46eSDavid Howells 	unsigned short	reserved[2];
69607ca46eSDavid Howells 	unsigned short	startoffs;
70607ca46eSDavid Howells 	unsigned short	winoffs;
71607ca46eSDavid Howells 	unsigned short	codeoffs;
72607ca46eSDavid Howells 	unsigned long	codesize;
73607ca46eSDavid Howells 	unsigned short	dataoffs;
74607ca46eSDavid Howells 	unsigned long	datasize;
75607ca46eSDavid Howells };
76607ca46eSDavid Howells 
77607ca46eSDavid Howells /**
78607ca46eSDavid Howells  *	struct cycx_firmware - CYCX firmware file structure
79607ca46eSDavid Howells  *	@signature - CFM file signature
80607ca46eSDavid Howells  *	@version - file format version
81607ca46eSDavid Howells  *	@checksum - info + image
82607ca46eSDavid Howells  *	@reserved - reserved
83607ca46eSDavid Howells  *	@descr - description string
84607ca46eSDavid Howells  *	@info - firmware module info
85607ca46eSDavid Howells  *	@image - code image (variable size)
86607ca46eSDavid Howells  */
87607ca46eSDavid Howells struct cycx_firmware {
88607ca46eSDavid Howells 	char		    signature[80];
89607ca46eSDavid Howells 	unsigned short	    version;
90607ca46eSDavid Howells 	unsigned short	    checksum;
91607ca46eSDavid Howells 	unsigned short	    reserved[6];
92607ca46eSDavid Howells 	char		    descr[CFM_DESCR_LEN];
93607ca46eSDavid Howells 	struct cycx_fw_info info;
94*94dfc73eSGustavo A. R. Silva 	unsigned char	    image[];
95607ca46eSDavid Howells };
96607ca46eSDavid Howells 
97607ca46eSDavid Howells struct cycx_fw_header {
98607ca46eSDavid Howells 	unsigned long  reset_size;
99607ca46eSDavid Howells 	unsigned long  data_size;
100607ca46eSDavid Howells 	unsigned long  code_size;
101607ca46eSDavid Howells };
102607ca46eSDavid Howells #endif	/* _CYCX_CFM_H */
103