diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-12-08 22:36:38 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-12-08 22:36:38 -0500 |
commit | f4b98415953dcf85bac4ea0a2264a3ead4a7bcc4 (patch) | |
tree | 7195ababc3542402a794036b98d480b81a147c0f /arch/powerpc/include | |
parent | 46f5221049bb46b0188aad6b6dfab5dbc778be22 (diff) | |
parent | 6024ede9ba84aa1b891c2d6bc98eda07801235e5 (diff) |
Merge branch 'nvram' into next
Diffstat (limited to 'arch/powerpc/include')
-rw-r--r-- | arch/powerpc/include/asm/nvram.h | 52 |
1 files changed, 11 insertions, 41 deletions
diff --git a/arch/powerpc/include/asm/nvram.h b/arch/powerpc/include/asm/nvram.h index 850b72f27445..92efe67d1c57 100644 --- a/arch/powerpc/include/asm/nvram.h +++ b/arch/powerpc/include/asm/nvram.h | |||
@@ -10,31 +10,7 @@ | |||
10 | #ifndef _ASM_POWERPC_NVRAM_H | 10 | #ifndef _ASM_POWERPC_NVRAM_H |
11 | #define _ASM_POWERPC_NVRAM_H | 11 | #define _ASM_POWERPC_NVRAM_H |
12 | 12 | ||
13 | #include <linux/errno.h> | 13 | /* Signatures for nvram partitions */ |
14 | |||
15 | #define NVRW_CNT 0x20 | ||
16 | #define NVRAM_HEADER_LEN 16 /* sizeof(struct nvram_header) */ | ||
17 | #define NVRAM_BLOCK_LEN 16 | ||
18 | #define NVRAM_MAX_REQ (2080/NVRAM_BLOCK_LEN) | ||
19 | #define NVRAM_MIN_REQ (1056/NVRAM_BLOCK_LEN) | ||
20 | |||
21 | #define NVRAM_AS0 0x74 | ||
22 | #define NVRAM_AS1 0x75 | ||
23 | #define NVRAM_DATA 0x77 | ||
24 | |||
25 | |||
26 | /* RTC Offsets */ | ||
27 | |||
28 | #define MOTO_RTC_SECONDS 0x1FF9 | ||
29 | #define MOTO_RTC_MINUTES 0x1FFA | ||
30 | #define MOTO_RTC_HOURS 0x1FFB | ||
31 | #define MOTO_RTC_DAY_OF_WEEK 0x1FFC | ||
32 | #define MOTO_RTC_DAY_OF_MONTH 0x1FFD | ||
33 | #define MOTO_RTC_MONTH 0x1FFE | ||
34 | #define MOTO_RTC_YEAR 0x1FFF | ||
35 | #define MOTO_RTC_CONTROLA 0x1FF8 | ||
36 | #define MOTO_RTC_CONTROLB 0x1FF9 | ||
37 | |||
38 | #define NVRAM_SIG_SP 0x02 /* support processor */ | 14 | #define NVRAM_SIG_SP 0x02 /* support processor */ |
39 | #define NVRAM_SIG_OF 0x50 /* open firmware config */ | 15 | #define NVRAM_SIG_OF 0x50 /* open firmware config */ |
40 | #define NVRAM_SIG_FW 0x51 /* general firmware */ | 16 | #define NVRAM_SIG_FW 0x51 /* general firmware */ |
@@ -49,32 +25,19 @@ | |||
49 | #define NVRAM_SIG_OS 0xa0 /* OS defined */ | 25 | #define NVRAM_SIG_OS 0xa0 /* OS defined */ |
50 | #define NVRAM_SIG_PANIC 0xa1 /* Apple OSX "panic" */ | 26 | #define NVRAM_SIG_PANIC 0xa1 /* Apple OSX "panic" */ |
51 | 27 | ||
52 | /* If change this size, then change the size of NVNAME_LEN */ | ||
53 | struct nvram_header { | ||
54 | unsigned char signature; | ||
55 | unsigned char checksum; | ||
56 | unsigned short length; | ||
57 | char name[12]; | ||
58 | }; | ||
59 | |||
60 | #ifdef __KERNEL__ | 28 | #ifdef __KERNEL__ |
61 | 29 | ||
30 | #include <linux/errno.h> | ||
62 | #include <linux/list.h> | 31 | #include <linux/list.h> |
63 | 32 | ||
64 | struct nvram_partition { | 33 | #ifdef CONFIG_PPC_PSERIES |
65 | struct list_head partition; | ||
66 | struct nvram_header header; | ||
67 | unsigned int index; | ||
68 | }; | ||
69 | |||
70 | |||
71 | extern int nvram_write_error_log(char * buff, int length, | 34 | extern int nvram_write_error_log(char * buff, int length, |
72 | unsigned int err_type, unsigned int err_seq); | 35 | unsigned int err_type, unsigned int err_seq); |
73 | extern int nvram_read_error_log(char * buff, int length, | 36 | extern int nvram_read_error_log(char * buff, int length, |
74 | unsigned int * err_type, unsigned int *err_seq); | 37 | unsigned int * err_type, unsigned int *err_seq); |
75 | extern int nvram_clear_error_log(void); | 38 | extern int nvram_clear_error_log(void); |
76 | |||
77 | extern int pSeries_nvram_init(void); | 39 | extern int pSeries_nvram_init(void); |
40 | #endif /* CONFIG_PPC_PSERIES */ | ||
78 | 41 | ||
79 | #ifdef CONFIG_MMIO_NVRAM | 42 | #ifdef CONFIG_MMIO_NVRAM |
80 | extern int mmio_nvram_init(void); | 43 | extern int mmio_nvram_init(void); |
@@ -85,6 +48,13 @@ static inline int mmio_nvram_init(void) | |||
85 | } | 48 | } |
86 | #endif | 49 | #endif |
87 | 50 | ||
51 | extern int __init nvram_scan_partitions(void); | ||
52 | extern loff_t nvram_create_partition(const char *name, int sig, | ||
53 | int req_size, int min_size); | ||
54 | extern int nvram_remove_partition(const char *name, int sig); | ||
55 | extern int nvram_get_partition_size(loff_t data_index); | ||
56 | extern loff_t nvram_find_partition(const char *name, int sig, int *out_size); | ||
57 | |||
88 | #endif /* __KERNEL__ */ | 58 | #endif /* __KERNEL__ */ |
89 | 59 | ||
90 | /* PowerMac specific nvram stuffs */ | 60 | /* PowerMac specific nvram stuffs */ |