~ubuntu-branches/ubuntu/wily/slof/wily

« back to all changes in this revision

Viewing changes to board-qemu/include/nvramlog.h

  • Committer: Package Import Robot
  • Author(s): Aurelien Jarno
  • Date: 2012-09-16 23:05:23 UTC
  • Revision ID: package-import@ubuntu.com-20120916230523-r2ynulqmp2tyu2e5
Tags: upstream-20120217+dfsg
ImportĀ upstreamĀ versionĀ 20120217+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/******************************************************************************
 
2
 * Copyright (c) 2004, 2011 IBM Corporation
 
3
 * All rights reserved.
 
4
 * This program and the accompanying materials
 
5
 * are made available under the terms of the BSD License
 
6
 * which accompanies this distribution, and is available at
 
7
 * http://www.opensource.org/licenses/bsd-license.php
 
8
 *
 
9
 * Contributors:
 
10
 *     IBM Corporation - initial implementation
 
11
 *****************************************************************************/
 
12
 
 
13
#ifndef NVRAMLOG_H
 
14
        #define NVRAMLOG_H
 
15
 
 
16
/* ----------------------------------------------------------------------------
 
17
 *      NVRAM Log-Partition header design:
 
18
 *
 
19
 *      Partition Header
 
20
 *      00h     - signature     ( 1 byte)
 
21
 *      01h     - checksum      ( 1 byte)
 
22
 *      02h     - length        ( 2 byte) value = 1st_byte*256 + 2nd_byte
 
23
 *      04h     - name          (12 byte)
 
24
 *      space for partiton header = 16 byte
 
25
 *
 
26
 *      Log Header
 
27
 *      10h     - offset        ( 2 byte) from Partition Header to Data Section
 
28
 *      12h     - flags         ( 2 byte) control flags
 
29
 *      14h     - pointer       ( 4 byte) pointer to first free byte in Data Section
 
30
 *                                        relative to the beginning of the data section
 
31
 *      18h     - zero          ( 32 byte) reserved as stack for four  64 bit register
 
32
 *      38h - reserved          (  8 byte) reserved for 64 bit CRC (not implemented yet)
 
33
 *      space for header = 64 byte
 
34
 *      Data Section
 
35
 *      40h     - cyclic data
 
36
 * -------------------------------------------------------------------------------- */
 
37
 
 
38
        // initial values
 
39
        #define LLFW_LOG_BE0_SIGNATURE          0x51                    // signature for general firmware usage
 
40
        #define LLFW_LOG_BE0_NAME_PREFIX        0x69626D2C              // first 4 bytes of name: "ibm,"
 
41
        #define LLFW_LOG_BE0_NAME               0x435055306C6F6700      // remaining 8 bytes    : "CPU0log\0"
 
42
        #define LLFW_LOG_BE0_LENGTH             0x200                   // Partition length in block of 16 bytes
 
43
        #define LLFW_LOG_BE0_DATA_OFFSET        0x40                    // offset in bytes between header and data
 
44
        #define LLFW_LOG_BE0_FLAGS              0                       // unused
 
45
 
 
46
        #define LLFW_LOG_BE1_SIGNATURE          0x51                    // signature for general firmware usage
 
47
        #define LLFW_LOG_BE1_NAME_PREFIX        0x69626D2C              // first 4 bytes of name: "ibm,"
 
48
        #define LLFW_LOG_BE1_NAME               0x435055316C6F6700      // remaining 8 bytes    : "CPU1log\0\0"
 
49
        #define LLFW_LOG_BE1_LENGTH             0x80                    // Partition length in block of 16 bytes
 
50
        #define LLFW_LOG_BE1_DATA_OFFSET        0x40                    // offset in bytes between header and data
 
51
        #define LLFW_LOG_BE1_FLAGS              0x0                     // unused
 
52
 
 
53
        // positions of the initial values
 
54
        #define LLFW_LOG_POS_CHECKSUM   0x01                    // 1
 
55
        #define LLFW_LOG_POS_LENGTH     0x02                    // 2
 
56
        #define LLFW_LOG_POS_NAME       0x04                    // 4
 
57
        #define LLFW_LOG_POS_DATA_OFFSET 0x10                   // 16
 
58
        #define LLFW_LOG_POS_FLAGS      0x12                    // 18
 
59
        #define LLFW_LOG_POS_POINTER    0x14                    // 20
 
60
 
 
61
        // NVRAM info
 
62
        #define NVRAM_EMPTY_PATTERN     0x0000000000000000      // Pattern (64-bit) used to overwrite NVRAM
 
63
 
 
64
#endif