add new switch configuration api
[openwrt/openwrt.git] / target / linux / brcm47xx / files / arch / mips / bcm947xx / include / nvram.h
1 /*
2 * Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org>
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 */
9
10 #ifndef __NVRAM_H
11 #define __NVRAM_H
12
13 struct nvram_header {
14 u32 magic;
15 u32 len;
16 u32 crc_ver_init; /* 0:7 crc, 8:15 ver, 16:31 sdram_init */
17 u32 config_refresh; /* 0:15 sdram_config, 16:31 sdram_refresh */
18 u32 config_ncdl; /* ncdl values for memc */
19 };
20
21 struct nvram_tuple {
22 char *name;
23 char *value;
24 struct nvram_tuple *next;
25 };
26
27 #define NVRAM_HEADER 0x48534C46 /* 'FLSH' */
28 #define NVRAM_VERSION 1
29 #define NVRAM_HEADER_SIZE 20
30 #define NVRAM_SPACE 0x8000
31
32 #define NVRAM_MAX_VALUE_LEN 255
33 #define NVRAM_MAX_PARAM_LEN 64
34
35 char *nvram_get(const char *name);
36
37 #endif