summaryrefslogtreecommitdiff
path: root/cleopatre/u-boot-1.1.6/tools/mknvram/spc300_nvram.h
blob: d5327ccc275da76e908bd2c3084a12b5bb31650e (plain)
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
/*
 * tools/mknvram/spc300_nvram.h
 *
 * Copyright (C) 2009 SPiDCOM Technologies
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 * MA 02111-1307 USA
 *
 * Author(s):
 * May 2009  Drasko DRASKOVIC    <drasko.draskovic@spidcom.com>
 */

#ifndef _SPC300_NVRAM_H_
#define _SPC300_NVRAM_H_

#define SPC300_NVRAM_MAGIC "NVRAM\0\0\0"
#define SPC300_NVRAM_ARCH  0
#define SPC300_NVRAM_IS_VALID(desc)     (   !memcmp((desc)->magic, SPIDCOM_IMG_DESC_MAGIC, 8) && \
                                            (desc)->is_valid && \
                                            ( (desc)->index != SPIDCOM_IMG_DESC_INVALID_INDEX )     )

/* /!\ All values are LITTLE-ENDIAN */
typedef struct
{
    char            magic[8];                   /* magic number "NVRAM\0\0\0" */
	uint32_t        pineout_cfg;            /* SPC300 pineout configuration register */
	uint32_t        sdram_config;           /* SPC300 SDRAM configuration register */
	uint32_t        sdram_timing0;          /* SPC300 SDRAM timing register 0 */
	uint32_t        sdram_timing1;          /* SPC300 SDRAM timing register 1 */
	uint32_t        sdram_refresh;          /* SPC300 SDRAM refresh register */
	uint32_t        nb_images;              /* Max Number of Images present in flash */
	char            product_name[16];       /* product short name in string format */
	char            product_partnb[16];     /* product part number in string format */
	char            product_desc[128];      /* product long description in string format */
	char            serial_number[16];      /* product serial number in string format */
	unsigned char   eth_address[6];         /* ethernet MAC address */
	unsigned char   reserved1[2];
	unsigned char   plc_address[6];         /* powerline MAC address */
	unsigned char   reserved2[2];
	char            device_password[32];    /* HomeplugAV device unique password (DPW) */
	char            oem_info[64];           /* additional information for oem */
} spc300_nvram_t __attribute__((packed));

#endif  /* _SPC300_NVRAM_H_ */