libsmbios_c library
RbuLowLevel.h
Go to the documentation of this file.
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2  * vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=c:cindent:textwidth=0:
3  *
4  * Copyright (C) 2005 Dell Inc.
5  * by Michael Brown <Michael_E_Brown@dell.com>
6  * Licensed under the Open Software License version 2.1
7  *
8  * Alternatively, you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published
10  * by the Free Software Foundation; either version 2 of the License,
11  * or (at your option) any later version.
12 
13  * This program is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  * See the GNU General Public License for more details.
17  */
18 
19 #ifndef RBULOWLEVEL_H
20 #define RBULOWLEVEL_H
21 
22 // compat header should always be first header if including system headers
23 #include "smbios/compat.h"
24 
25 # define RBU_SMBIOS_STRUCT (0xDE)
26 # define RBU_ACTIVATE (0x005c)
27 # define RBU_CANCEL (0x005d)
28 
29 // WARNING WARNING WARNING
30 //
31 // This file is not guaranteed to be API/ABI stable. Include it at your own risk.
32 //
33 // WARNING WARNING WARNING
34 
35 namespace rbu
36 {
37 # if defined(_MSC_VER)
38 # pragma pack(push,1)
39 # endif
40 
41  /* RBU packets are 4 KB-aligned and consist of a header and data. The packet header contains the necessary information for BIOS to find the packets in memory, and assemble them in proper order. */
42 
43  struct rbu_packet
44  {
45  u32 pktId; // must be '$RPK'
46  u16 pktSize; // size of packet in KB
48  u16 hdrSize; // size of packet header in paragraphs (16 byte chunks)
50  u32 pktSetId; // unique id for packet set, can be anything
51  u16 pktNum; // sequential pkt number (only thing that changes)
52  u16 totPkts; // total number of packets
53  u8 pktVer; // version == 1 for now
55  u16 pktChksum; // sum all bytes in pkt must be zero
56  u8 pktData; // Start of packet data.
57  }
59 
60 
61  /* RBU Packet Requirements
62 
63  1.All values in the packet header except PktNum must be the same for all packets in a set with the following exception:
64  -- Packet 0 may have a different packet size (PktSize).
65  -- checksums
66  2.Packet 0 data does not contain RBU data. Packet 1 contains the first chunk of RBU data.
67  3.Packet data begins immediately after the header. Packet data size and offset can be calculated from PktSize and HdrSize.
68  4.Reserved fields are 0.
69  5.If multiple packets sets are written to memory, all packet sets must be identical.
70  6.All packets must start on 4 KB boundaries.
71  7.All packets must be placed in non-paged memory.
72  8.The maximum size of a packet is 64 MB.
73  9.The maximum size of a packet header is 4 KB.
74  10.The maximum number of packets is 64 KB - 1.
75  11.CPU INIT# must be immediately asserted (e.g. via OS shutdown/restart) after the RBU packet set is placed in memory.
76  12.PktChk is the value resulting in a zero sum of all packet words (header and data).
77  13.PktSetId uniquely identifies a packet set. BIOS aborts the packet search if all packets do not have the same PkSetId. Example identifiers: a 4-character ASCII ID string (e.g. “_A00”), a 4-byte hash value (e.g. CRC).
78  */
79 
80  /* RBU Packet 0 */
81 
82  struct rbu_packet_0
83  {
85  u8 passwordCheckInfo; // bit 7: passwordCheck is present bits 0-6: reserved
86  u32 passwordCheck; // crc-32 of admin/setup password
87  // the rest is reserved for future expansion.
88  }
90 
91  /* RBU Packet 0 Definition
92 
93  Packet 0 is reserved for packet set information. Packet 0 data consists of data items -- each item consists of an info byte followed by the actual data item. If bit 0 of the info byte is 1, the actual data starting at the next byte is present. If bit 0 is 0, the data is not present.
94 
95  The system flash password is currently defined as the admin or setup password.
96 
97  BIOS reject the packet set when:
98  1.The packet set flash password CRC and the system flash password CRC do not match.
99  2.The packet set flash password CRC is not present but the system flash password is present.
100 
101  */
102 
103 
104  /*
105  RBU BIOS UPDATE HEADER FILE (.HDR) structure
106  */
107 
108  const int NUM_SYS_ID_IN_HDR = 12;
109 
111  {
112  char headerId[4];
117  char quickCheck[40];
118  char biosVersion[3];
124  Contains the list of NumSystems Dell System ID and Hardware Revision
125  ID pairs for which the Image Data is valid, in the following format:
126  Bit Range Description
127  15:11 Dell System ID, bits 12:8.
128  This range is set to 00000b if the Dell System ID
129  is a 1-byte value.
130  10:8 Hardware Revision ID
131  7:0 Dell System ID, bits 7:0. */
132  }
134 
135 # if defined(_MSC_VER)
136 # pragma pack(pop)
137 # endif
138 
139 }
140 
141 #endif /* RBUIMPL_H */
u8 biosInternalUse
Definition: RbuLowLevel.h:120
u8 numSystems
Definition: RbuLowLevel.h:116
Definition: RbuLowLevel.h:43
u16 totPkts
Definition: RbuLowLevel.h:52
u16 reserved1
Definition: RbuLowLevel.h:47
rbu_packet header
Definition: RbuLowLevel.h:84
u16 pktChksum
Definition: RbuLowLevel.h:55
Definition: DellRbu.h:36
struct rbu::rbu_packet LIBSMBIOS_PACKED_ATTR
u8 headerMinorVer
Definition: RbuLowLevel.h:115
u16 reserved2
Definition: RbuLowLevel.h:49
u16 hdrSize
Definition: RbuLowLevel.h:48
u16 pktNum
Definition: RbuLowLevel.h:51
u8 reserved[5]
Definition: RbuLowLevel.h:121
u16 compatFlags
Definition: RbuLowLevel.h:122
u32 pktSetId
Definition: RbuLowLevel.h:50
u8 pktVer
Definition: RbuLowLevel.h:53
u8 pktData
Definition: RbuLowLevel.h:56
u8 headerLength
Definition: RbuLowLevel.h:113
char headerId[4]
Definition: RbuLowLevel.h:112
u8 headerMajorVer
Definition: RbuLowLevel.h:114
u8 passwordCheckInfo
Definition: RbuLowLevel.h:85
u16 systemIdList[NUM_SYS_ID_IN_HDR]
Definition: RbuLowLevel.h:123
char quickCheck[40]
Definition: RbuLowLevel.h:117
u32 passwordCheck
Definition: RbuLowLevel.h:86
unsigned int u32
Definition: types.h:35
Definition: RbuLowLevel.h:110
unsigned short u16
Definition: types.h:31
unsigned char u8
Definition: types.h:27
u32 pktId
Definition: RbuLowLevel.h:45
u8 miscFlags
Definition: RbuLowLevel.h:119
const int NUM_SYS_ID_IN_HDR
Definition: RbuLowLevel.h:108
Definition: RbuLowLevel.h:82
char biosVersion[3]
Definition: RbuLowLevel.h:118
u8 reserved[9]
Definition: RbuLowLevel.h:54
u16 pktSize
Definition: RbuLowLevel.h:46