blob: 1d9eb7fe200b9cbca26bfab4c269a79a4a65dd1a [file] [log] [blame]
wdenk4a5b6a32001-04-28 17:59:11 +00001#ifndef __vpd_h
2#define __vpd_h
3
4/*
5 * Module name: %M%
6 * Description:
7 * Vital Product Data (VPD) Header Module
8 * SCCS identification: %I%
9 * Branch: %B%
10 * Sequence: %S%
11 * Date newest applied delta was created (MM/DD/YY): %G%
12 * Time newest applied delta was created (HH:MM:SS): %U%
13 * SCCS file name %F%
14 * Fully qualified SCCS file name:
15 * %P%
16 * Copyright:
17 * (C) COPYRIGHT MOTOROLA, INC. 1996
18 * ALL RIGHTS RESERVED
19 * Notes:
20 * History:
21 * Date Who
22 *
23 * 10/24/96 Rob Baxter
24 * Initial release.
25 *
26 */
27
28#define VPD_EEPROM_SIZE 256 /* EEPROM size in bytes */
29
30/*
31 * packet tuple identifiers
32 *
33 * 0x0D - 0xBF reserved
34 * 0xC0 - 0xFE user defined
35 */
36#define VPD_PID_GI 0x00 /* guaranteed illegal */
37#define VPD_PID_PID 0x01 /* product identifier (ASCII) */
38#define VPD_PID_FAN 0x02 /* factory assembly-number (ASCII) */
39#define VPD_PID_SN 0x03 /* serial-number (ASCII) */
40#define VPD_PID_PCO 0x04 /* product configuration options(binary) */
41#define VPD_PID_ICS 0x05 /* internal clock speed in HZ (integer) */
42#define VPD_PID_ECS 0x06 /* external clock speed in HZ (integer) */
43#define VPD_PID_RCS 0x07 /* reference clock speed in HZ(integer) */
44#define VPD_PID_EA 0x08 /* ethernet address (binary) */
45#define VPD_PID_MT 0x09 /* microprocessor type (ASCII) */
46#define VPD_PID_CRC 0x0A /* EEPROM CRC (integer) */
47#define VPD_PID_FMC 0x0B /* FLASH memory configuration (binary) */
48#define VPD_PID_VLSI 0x0C /* VLSI revisions/versions (binary) */
49#define VPD_PID_TERM 0xFF /* termination */
50
51/*
52 * VPD structure (format)
53 */
54#define VPD_EYE_SIZE 8 /* eyecatcher size */
55typedef struct vpd_header
56{
57 uchar eyecatcher[VPD_EYE_SIZE]; /* eyecatcher - "MOTOROLA" */
58 ushort size; /* size of EEPROM */
59} vpd_header_t;
60
61#define VPD_DATA_SIZE (VPD_EEPROM_SIZE-sizeof(vpd_header_t))
62typedef struct vpd
63{
64 vpd_header_t header; /* header */
65 uchar packets[VPD_DATA_SIZE]; /* data */
66} vpd_t;
67
68/*
69 * packet tuple structure (format)
70 */
71typedef struct vpd_packet
72{
73 uchar identifier; /* identifier (PIDs above) */
74 uchar size; /* size of the following data area */
75 uchar data[1]; /* data (size is dependent upon PID) */
76} vpd_packet_t;
77
78/*
79 * MBX product configuration options bit definitions
80 *
81 * Notes:
82 * 1. The bit numbering is reversed in perspective with the C compiler.
83 */
84#define PCO_BBRAM (1<<0) /* battery-backed RAM (BBRAM) and socket */
85#define PCO_BOOTROM (1<<1) /* boot ROM and socket (i.e., socketed FLASH) */
86#define PCO_KAPWR (1<<2) /* keep alive power source (lithium battey) and control circuit */
87#define PCO_ENET_TP (1<<3) /* ethernet twisted pair (TP) connector (RJ45) */
88#define PCO_ENET_AUI (1<<4) /* ethernet attachment unit interface (AUI) header */
89#define PCO_PCMCIA (1<<5) /* PCMCIA socket */
90#define PCO_DIMM (1<<6) /* DIMM module socket */
91#define PCO_DTT (1<<7) /* digital thermometer and thermostat (DTT) device */
92#define PCO_LCD (1<<8) /* liquid crystal display (LCD) device */
93#define PCO_PCI (1<<9) /* PCI-Bus bridge device (QSpan) and ISA-Bus bridge device (Winbond) */
94#define PCO_PCIO (1<<10) /* PC I/O (COM1, COM2, FDC, LPT, Keyboard/Mouse) */
95#define PCO_EIDE (1<<11) /* enhanced IDE (EIDE) header */
96#define PCO_FDC (1<<12) /* floppy disk controller (FDC) header */
97#define PCO_LPT_8XX (1<<13) /* parallel port header via MPC8xx */
98#define PCO_LPT_PCIO (1<<14) /* parallel port header via PC I/O */
99
100/*
101 * FLASH memory configuration packet data
102 */
103typedef struct vpd_fmc
104{
105 ushort mid; /* manufacturer's idenitfier */
106 ushort did; /* manufacturer's device idenitfier */
107 uchar ddw; /* device data width (e.g., 8-bits, 16-bits) */
108 uchar nod; /* number of devices present */
109 uchar noc; /* number of columns */
110 uchar cw; /* column width in bits */
111 uchar wedw; /* write/erase data width */
112} vpd_fmc_t;
113
114/* function prototypes */
115extern void vpd_init(void);
116extern int vpd_read(uint iic_device, uchar *buf, int count, int offset);
117extern vpd_packet_t *vpd_find_packet(u_char ident);
118
119#endif /* __vpd_h */