xref: /kernel/linux/linux-5.10/drivers/atm/zeprom.h (revision 8c2ecf20)
18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci/* drivers/atm/zeprom.h - ZeitNet ZN122x EEPROM (NM93C46) declarations */
38c2ecf20Sopenharmony_ci
48c2ecf20Sopenharmony_ci/* Written 1995,1996 by Werner Almesberger, EPFL LRC */
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci#ifndef DRIVER_ATM_ZEPROM_H
88c2ecf20Sopenharmony_ci#define DRIVER_ATM_ZEPROM_H
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci/* Different versions use different control registers */
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#define ZEPROM_V1_REG	PCI_VENDOR_ID	/* PCI register */
138c2ecf20Sopenharmony_ci#define ZEPROM_V2_REG	0x40
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci/* Bits in contol register */
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci#define ZEPROM_SK	0x80000000	/* strobe (probably on raising edge) */
188c2ecf20Sopenharmony_ci#define ZEPROM_CS	0x40000000	/* Chip Select */
198c2ecf20Sopenharmony_ci#define ZEPROM_DI	0x20000000	/* Data Input */
208c2ecf20Sopenharmony_ci#define ZEPROM_DO	0x10000000	/* Data Output */
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci#define ZEPROM_SIZE	32		/* 32 bytes */
238c2ecf20Sopenharmony_ci#define ZEPROM_V1_ESI_OFF 24		/* ESI offset in EEPROM (V1) */
248c2ecf20Sopenharmony_ci#define ZEPROM_V2_ESI_OFF 4		/* ESI offset in EEPROM (V2) */
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci#define ZEPROM_CMD_LEN	3		/* commands are three bits */
278c2ecf20Sopenharmony_ci#define ZEPROM_ADDR_LEN	6		/* addresses are six bits */
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci/* Commands (3 bits) */
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ci#define ZEPROM_CMD_READ	6
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ci/* No other commands are needed. */
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci#endif
36