2 * (C) Copyright 2010, 2011
3 * NVIDIA Corporation <www.nvidia.com>
5 * See file CREDITS for list of people who contributed to this
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 #define STRAP_OPT_A_RAM_CODE_SHIFT 4
28 #define STRAP_OPT_A_RAM_CODE_MASK (0xf << STRAP_OPT_A_RAM_CODE_SHIFT)
30 /* Defines the supported operating modes */
31 enum fuse_operating_mode {
36 /* Defines the CMAC-AES-128 hash length in 32 bit words. (128 bits = 4 words) */
41 /* Defines the storage for a hash value (128 bits) */
43 u32 hash[HASH_LENGTH];
47 * Defines the code header information for the boot rom.
49 * The code immediately follows the code header.
51 * Note that the code header needs to be 16 bytes aligned to preserve
52 * the alignment of relevant data for hash and decryption computations without
53 * requiring extra copies to temporary memory areas.
56 u32 length_insecure; /* length of the code header */
58 struct hash hash; /* hash of header+code, starts next field*/
59 struct hash random_aes_block; /* a data block to aid security. */
60 u32 length_secure; /* length of the code header */
61 u32 destination; /* destination address to put the wb code */
62 u32 entry_point; /* execution address of the wb code */
63 u32 code_length; /* length of the code */
67 * The warm boot code needs direct access to these registers since it runs in
68 * SRAM and cannot call other U-Boot code.
103 union pllx_misc_reg {
122 * TODO: This register is not documented in the TRM yet. We could move this
123 * into the EMC and give it a proper interface, but not while it is
128 u32 pllx_base_divm:5;
129 u32 pllx_base_divn:10;
130 u32 pllx_base_divp:3;
131 u32 pllx_misc_lfcon:4;
132 u32 pllx_misc_cpcon:4;
139 * Save warmboot memory settings for a later resume
141 * @return 0 if ok, -1 on error
143 int warmboot_save_sdram_params(void);
145 int warmboot_prepare_code(u32 seg_address, u32 seg_length);
146 int sign_data_block(u8 *source, u32 length, u8 *signature);
147 void wb_start(void); /* Start of WB assembly code */
148 void wb_end(void); /* End of WB assembly code */