openMMC
Open Source Modular MMC for AMCs
Loading...
Searching...
No Matches
hpm.h
Go to the documentation of this file.
1/*
2 * openMMC -- Open Source modular IPM Controller firmware
3 *
4 * Copyright (C) 2015-2016 Henrique Silva <henrique.silva@lnls.br>
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 *
19 * @license GPL-3.0+ <http://spdx.org/licenses/GPL-3.0+>
20 */
21
22#ifndef HPM_H_
23#define HPM_H_
24
25#define HPM_SUPPORTED_VERSION 0x00
26
27#define FW_REV_MAJOR 1 /* Binary encoded */
28#define FW_REV_MINOR 0 /* BCD encoded */
29#define FW_REV_AUX_0 0
30#define FW_REV_AUX_1 0
31#define FW_REV_AUX_2 0
32#define FW_REV_AUX_3 0
33
34#define HPM_UPGRADE_TIMEOUT 10 /* in 5 seconds counts */
35#define HPM_SELF_TEST_TIMEOUT 5 /* in 5 seconds counts */
36#define HPM_ROLLBACK_TIMEOUT 10 /* in 5 seconds counts */
37#define HPM_INACCESSIBILITY_TIMEOUT 10 /* in 5 seconds counts */
38
39#define HPM_BLOCK_SIZE 64
40
41/* Components ID */
42enum {
47};
48
49typedef uint8_t (* t_hpm_upload_block)(uint8_t * block, uint16_t size);
50typedef uint8_t (* t_hpm_finish_upload)(uint32_t image_size);
51typedef uint8_t (* t_hpm_prepare_comp)(void);
52typedef uint8_t (* t_hpm_get_upgrade_status)(void);
53typedef uint8_t (* t_hpm_activate_firmware)(void);
54
55
56/*
57 * Define the "Get target upgrade capabilities" message struct as define in the
58 * Hardware Platform Management IPM Controller Firmware Upgrade Specification, Table 3-3
59 */
60typedef union {
61 struct {
62 uint8_t self_test:1;
64 uint8_t manual_rollback:1;
70 } flags;
71 uint8_t byte;
73
74typedef union __attribute__ ((__packed__)) {
75 struct {
76 uint8_t reserved:2,
77 cold_reset_required:1,
78 deferred_activation_supported:1,
79 comparison_supported:1,
80 preparation_support:1,
81 rollback_backup_support:2;
82 } flags;
83 uint8_t byte;
85
95
96#endif
uint8_t(* t_hpm_prepare_comp)(void)
Definition hpm.h:51
t_comp_properties
Definition hpm.h:84
uint8_t(* t_hpm_get_upgrade_status)(void)
Definition hpm.h:52
uint8_t(* t_hpm_upload_block)(uint8_t *block, uint16_t size)
Definition hpm.h:49
uint8_t(* t_hpm_activate_firmware)(void)
Definition hpm.h:53
union __attribute__((__packed__))
Definition hpm.h:74
@ HPM_BOOTLOADER_COMPONENT_ID
Definition hpm.h:43
@ HPM_MAX_COMPONENTS
Definition hpm.h:46
@ HPM_PAYLOAD_COMPONENT_ID
Definition hpm.h:45
@ HPM_IPMC_COMPONENT_ID
Definition hpm.h:44
uint8_t(* t_hpm_finish_upload)(uint32_t image_size)
Definition hpm.h:50
Definition hpm.h:86
t_hpm_upload_block hpm_upload_block_f
Definition hpm.h:90
t_hpm_prepare_comp hpm_prepare_comp_f
Definition hpm.h:89
t_hpm_activate_firmware hpm_activate_firmware_f
Definition hpm.h:93
t_comp_properties properties
Definition hpm.h:87
t_hpm_get_upgrade_status hpm_get_upgrade_status_f
Definition hpm.h:92
t_hpm_finish_upload hpm_finish_upload_f
Definition hpm.h:91
Definition hpm.h:60
uint8_t automatic_rollback
Definition hpm.h:63
uint8_t byte
Definition hpm.h:71
uint8_t automatic_rollback_overridden
Definition hpm.h:68
uint8_t self_test
Definition hpm.h:62
uint8_t upgrade_undesirable
Definition hpm.h:69
uint8_t ipmc_degraded_in_update
Definition hpm.h:67
uint8_t manual_rollback
Definition hpm.h:64
uint8_t deferred_activation
Definition hpm.h:66
uint8_t services_affected
Definition hpm.h:65