1228436Sfabient/*-
2228436Sfabient * Copyright (c) 2011 Fabien Thomas <fabient@FreeBSD.org>.
3228436Sfabient * All rights reserved.
4228436Sfabient *
5228436Sfabient * Redistribution and use in source and binary forms, with or without
6228436Sfabient * modification, are permitted provided that the following conditions
7228436Sfabient * are met:
8228436Sfabient * 1. Redistributions of source code must retain the above copyright
9228436Sfabient *    notice, this list of conditions and the following disclaimer.
10228436Sfabient * 2. Redistributions in binary form must reproduce the above copyright
11228436Sfabient *    notice, this list of conditions and the following disclaimer in the
12228436Sfabient *    documentation and/or other materials provided with the distribution.
13228436Sfabient *
14228436Sfabient * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15228436Sfabient * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16228436Sfabient * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17228436Sfabient * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18228436Sfabient * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19228436Sfabient * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20228436Sfabient * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21228436Sfabient * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22228436Sfabient * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23228436Sfabient * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24228436Sfabient *
25228436Sfabient * $FreeBSD$
26228436Sfabient */
27228436Sfabient
28228436Sfabient#ifndef VIA_H
29228436Sfabient#define	VIA_H
30228436Sfabient
31228436Sfabient/*
32228436Sfabient * Prototypes.
33228436Sfabient */
34228436Sfabientucode_probe_t	via_probe;
35228436Sfabientucode_update_t	via_update;
36228436Sfabient
37228436Sfabienttypedef struct via_fw_header {
38228436Sfabient	uint32_t	signature;		/* Signature. */
39228436Sfabient	int32_t		revision;		/* Unique version number. */
40228436Sfabient	uint32_t	date;			/* Date of creation in BCD. */
41228436Sfabient	uint32_t	cpu_signature;		/* Extended family, extended
42228436Sfabient						   model, type, family, model
43228436Sfabient						   and stepping. */
44228436Sfabient	uint32_t	checksum;		/* Sum of all DWORDS should
45228436Sfabient						   be 0. */
46228436Sfabient	uint32_t	loader_revision;	/* Version of the loader
47228436Sfabient						   required to load update. */
48228436Sfabient	uint32_t	reserverd1;		/* Platform IDs encoded in
49228436Sfabient						   the lower 8 bits. */
50228436Sfabient	uint32_t	data_size;
51228436Sfabient	uint32_t	total_size;
52228436Sfabient	uint8_t		reserved2[12];
53228436Sfabient} via_fw_header_t;
54228436Sfabient
55228436Sfabienttypedef struct via_cpu_signature {
56228436Sfabient	uint32_t	cpu_signature;
57228436Sfabient	uint32_t	checksum;
58228436Sfabient} via_cpu_signature_t;
59228436Sfabient
60228436Sfabient#define VIA_HEADER_SIGNATURE	0x53415252
61228436Sfabient#define VIA_LOADER_REVISION	0x00000001
62228436Sfabient
63228436Sfabient#endif /* !VIA_H */
64