1 /*---------------------------------------------------------------------------*
2   Project:  Boot block format for CAFE-boot1
3   File:     bootosBootBlock.h
4 
5   Copyright (C) Nintendo.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13  *---------------------------------------------------------------------------*/
14 
15 #ifndef __BOOTOS_BOOT_BLOCK_H__
16 #define __BOOTOS_BOOT_BLOCK_H__
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
22 
23 /*
24  * bsf offset                        dlf offset
25  * 0x0000_0000 +-------------------+ 0x0040_0000
26  *             |    Image Header   |
27  * 0x0000_0020 +-------------------+
28  *             |     Data Infos    |
29  * 0xXXXX_XXXX +-------------------+
30  *             |     Data Images   |
31  *             |                   |
32  *             |                   |
33  *             |                   |
34  *             +-------------------+
35  *
36  */
37 
38 #define BOOTOS_BOOT_BLOCK_MAGIC       0xFD9B5B7A
39 #define BOOTOS_BOOT_BLOCK_MAGIC_OFF   0
40 
41 #define BOOTOS_BOOT_BLOCK_FLAG_LOAD_PKG_IN_IOS  0x80000000
42 #define BOOTOS_BOOT_BLOCK_PASS_OPTS_VIA_CFG_REG 0x40000000
43 
44 typedef unsigned char   u8;
45 typedef unsigned int    u32;
46 typedef int             s32;
47 
48 // Header size should be 32 bytes
49 typedef struct
50 {
51     u32 magic;               // magic number
52     u32 num;                 // data info number
53     u32 platform_info_paddr; // physical address of platform info.
54     u32 package_info_paddr;  // physical address of package info.
55     u32 flags;               // flags for boot1
56     u32 ccrsyscfg1;          // Sticky register bits
57     u32 pad[2];              // pad to 32B
58 
59 } bootosBootBlockHeader;
60 
61 typedef struct bootosBootBlockDataInfo
62 {
63     u32 address; // address
64     u32 length;  // length
65 
66 } bootosBootBlockDataInfo;
67 
68 #ifdef __cplusplus
69 }
70 #endif
71 
72 #endif  // __BOOTOS_BOOT_BLOCK_H__
73