nfb_header.h
2.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*****************************************************************************
* Copyright Statement:
* --------------------
* This software is protected by Copyright and the information contained
* herein is confidential. The software may not be copied and the information
* contained herein may not be used or disclosed except with the written
* permission of MediaTek Inc. (C) 2001
*
*****************************************************************************/
/*****************************************************************************
*
* Filename:
* ---------
* nfb_header.h
*
* Project:
* --------
* NAND Booting
*
* Description:
* ------------
* NFB header structure.
*
* Author:
* -------
* -------
*
****************************************************************************/
#ifndef __NFB_HEADER_H__
#define __NFB_HEADER_H__
#include "br_sw_types.h"
/*******************************************************************************
* Macro definition
*******************************************************************************/
#define ECC_PARITY_BYTES (20)
#define NFB_LOOP_STOP (100)
/*******************************************************************************
* Type definition
*******************************************************************************/
typedef struct _NFIType
{
U16 IOInterface; /* IO_8BITS or IO_16BITS */
U16 pageSize; /* 512, 2048, 4096 bytes */
U16 addressCycle;
} NFI_MENU;
typedef struct __NFB_HEADER
{
char ID1[12];
char version[4];
char ID2[8];
NFI_MENU NFIinfo;
U16 spareSize;
U16 pagesPerBlock;
U16 totalBlocks;
U16 pageShift;
U16 blockShift;
U32 padding[6];
} NFB_HEADER;
typedef struct {
NFB_HEADER nfb_header_body;
U32 dummy_u32; // It forces the buffer pointer of NFB_HDR_SECTOR to be 4-bytes alignment address.
char nfb_dummy[128-sizeof(NFB_HEADER)-4-ECC_PARITY_BYTES];
U8 nfb_ecc_parities[ECC_PARITY_BYTES];
} NFB_HDR_SECTOR;
#define REPLICATION_NUMBER (512/sizeof(NFB_HDR_SECTOR))
typedef struct {
NFB_HDR_SECTOR nfb_hdr_sec[REPLICATION_NUMBER];
} NFB_HDR_REPLICATION;
#endif // __NFB_HEADER_H__