3 * Marvell Semiconductor <www.marvell.com>
4 * Written-by: Prafulla Wadaskar <prafulla@marvell.com>
6 * See file CREDITS for list of people who contributed to this
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of
12 * the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
30 #define KWBIMAGE_MAX_CONFIG ((0x1dc - 0x20)/sizeof(struct reg_config))
31 #define MAX_TEMPBUF_LEN 32
34 #define IBR_HDR_ECC_DEFAULT 0x00
35 #define IBR_HDR_ECC_FORCED_HAMMING 0x01
36 #define IBR_HDR_ECC_FORCED_RS 0x02
37 #define IBR_HDR_ECC_DISABLED 0x03
39 /* Boot Type - block ID */
40 #define IBR_HDR_I2C_ID 0x4D
41 #define IBR_HDR_SPI_ID 0x5A
42 #define IBR_HDR_NAND_ID 0x8B
43 #define IBR_HDR_SATA_ID 0x78
44 #define IBR_HDR_PEX_ID 0x9C
45 #define IBR_HDR_UART_ID 0x69
46 #define IBR_DEF_ATTRIB 0x00
58 enum kwbimage_cmd_types {
66 typedef struct bhr_t {
67 uint8_t blockid; /*0 */
68 uint8_t nandeccmode; /*1 */
69 uint16_t nandpagesize; /*2-3 */
70 uint32_t blocksize; /*4-7 */
71 uint32_t rsvd1; /*8-11 */
72 uint32_t srcaddr; /*12-15 */
73 uint32_t destaddr; /*16-19 */
74 uint32_t execaddr; /*20-23 */
75 uint8_t satapiomode; /*24 */
76 uint8_t rsvd3; /*25 */
77 uint16_t ddrinitdelay; /*26-27 */
78 uint16_t rsvd2; /*28-29 */
80 uint8_t checkSum; /*31 */
88 typedef struct extbhr_t {
89 uint32_t dramregsoffs;
90 uint8_t rsrvd1[0x20 - sizeof(uint32_t)];
91 struct reg_config rcfg[KWBIMAGE_MAX_CONFIG];
94 } extbhr_t, *pextbhr_t;
104 void init_kwb_image_type (void);
106 #endif /* _KWBIMAGE_H_ */