xref: /freebsd/usr.sbin/cpucontrol/intel.h (revision b3e7694832e81d7a904a10f525f8797b753bf0d3)
1e085f869SStanislav Sedov /*-
2*4d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
31de7b4b8SPedro F. Giffuni  *
4e085f869SStanislav Sedov  * Copyright (c) 2006, 2008 Stanislav Sedov <stas@FreeBSD.org>.
5e085f869SStanislav Sedov  * All rights reserved.
6e085f869SStanislav Sedov  *
7e085f869SStanislav Sedov  * Redistribution and use in source and binary forms, with or without
8e085f869SStanislav Sedov  * modification, are permitted provided that the following conditions
9e085f869SStanislav Sedov  * are met:
10e085f869SStanislav Sedov  * 1. Redistributions of source code must retain the above copyright
11e085f869SStanislav Sedov  *    notice, this list of conditions and the following disclaimer.
12e085f869SStanislav Sedov  * 2. Redistributions in binary form must reproduce the above copyright
13e085f869SStanislav Sedov  *    notice, this list of conditions and the following disclaimer in the
14e085f869SStanislav Sedov  *    documentation and/or other materials provided with the distribution.
15e085f869SStanislav Sedov  *
16e085f869SStanislav Sedov  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17e085f869SStanislav Sedov  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18e085f869SStanislav Sedov  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19e085f869SStanislav Sedov  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20e085f869SStanislav Sedov  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21e085f869SStanislav Sedov  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22e085f869SStanislav Sedov  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23e085f869SStanislav Sedov  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24e085f869SStanislav Sedov  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25e085f869SStanislav Sedov  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26e085f869SStanislav Sedov  */
27e085f869SStanislav Sedov 
28e085f869SStanislav Sedov #ifndef INTEL_H
29e085f869SStanislav Sedov #define	INTEL_H
30e085f869SStanislav Sedov 
31e085f869SStanislav Sedov /*
32e085f869SStanislav Sedov  * Prototypes.
33e085f869SStanislav Sedov  */
34e085f869SStanislav Sedov ucode_probe_t	intel_probe;
35e085f869SStanislav Sedov ucode_update_t	intel_update;
36e085f869SStanislav Sedov 
37e085f869SStanislav Sedov typedef struct intel_fw_header {
38e085f869SStanislav Sedov 	uint32_t	header_version;		/* Version of the header. */
39e085f869SStanislav Sedov 	int32_t		revision;		/* Unique version number. */
40e085f869SStanislav Sedov 	uint32_t	date;			/* Date of creation in BCD. */
41e085f869SStanislav Sedov 	uint32_t	cpu_signature;		/* Extended family, extended
42e085f869SStanislav Sedov 						   model, type, family, model
43e085f869SStanislav Sedov 						   and stepping. */
44e085f869SStanislav Sedov 	uint32_t	checksum;		/* Sum of all DWORDS should
45e085f869SStanislav Sedov 						   be 0. */
46e085f869SStanislav Sedov 	uint32_t	loader_revision;	/* Version of the loader
47e085f869SStanislav Sedov 						   required to load update. */
48e085f869SStanislav Sedov 	uint32_t	cpu_flags;		/* Platform IDs encoded in
49e085f869SStanislav Sedov 						   the lower 8 bits. */
50e085f869SStanislav Sedov 	uint32_t	data_size;
51e085f869SStanislav Sedov 	uint32_t	total_size;
52e085f869SStanislav Sedov 	uint8_t		reserved[12];
53e085f869SStanislav Sedov } intel_fw_header_t;
54e085f869SStanislav Sedov 
55e085f869SStanislav Sedov typedef struct intel_cpu_signature {
56e085f869SStanislav Sedov 	uint32_t	cpu_signature;
57e085f869SStanislav Sedov 	uint32_t	cpu_flags;
58e085f869SStanislav Sedov 	uint32_t	checksum;
59e085f869SStanislav Sedov } intel_cpu_signature_t;
60e085f869SStanislav Sedov 
61e085f869SStanislav Sedov typedef struct intel_ext_header {
62e085f869SStanislav Sedov 	uint32_t	sig_count;
63e085f869SStanislav Sedov 	uint32_t	checksum;
64e085f869SStanislav Sedov 	uint8_t		reserved[12];
65e085f869SStanislav Sedov } intel_ext_header_t;
66e085f869SStanislav Sedov 
67e085f869SStanislav Sedov #define	INTEL_HEADER_VERSION	0x00000001
68e085f869SStanislav Sedov #define	INTEL_LOADER_REVISION	0x00000001
69e085f869SStanislav Sedov 
70e085f869SStanislav Sedov #endif /* !INTEL_H */
71