Commit | Line | Data |
---|---|---|
1da177e4 | 1 | /* |
c55377ee | 2 | * NVRAM definitions and access functions. |
1da177e4 LT |
3 | * |
4 | * This program is free software; you can redistribute it and/or | |
5 | * modify it under the terms of the GNU General Public License | |
6 | * as published by the Free Software Foundation; either version | |
7 | * 2 of the License, or (at your option) any later version. | |
8 | */ | |
c55377ee PM |
9 | #ifndef _ASM_POWERPC_NVRAM_H |
10 | #define _ASM_POWERPC_NVRAM_H | |
1da177e4 | 11 | |
134d4956 | 12 | |
74d51d02 | 13 | #include <linux/errno.h> |
134d4956 | 14 | #include <linux/list.h> |
c3617f72 | 15 | #include <uapi/asm/nvram.h> |
134d4956 | 16 | |
edc79a2f | 17 | #ifdef CONFIG_PPC_PSERIES |
0f2342c8 LV |
18 | extern int nvram_write_error_log(char * buff, int length, |
19 | unsigned int err_type, unsigned int err_seq); | |
20 | extern int nvram_read_error_log(char * buff, int length, | |
21 | unsigned int * err_type, unsigned int *err_seq); | |
1da177e4 | 22 | extern int nvram_clear_error_log(void); |
1da177e4 | 23 | extern int pSeries_nvram_init(void); |
edc79a2f | 24 | #endif /* CONFIG_PPC_PSERIES */ |
4751505c IK |
25 | |
26 | #ifdef CONFIG_MMIO_NVRAM | |
f3f66f59 | 27 | extern int mmio_nvram_init(void); |
4751505c IK |
28 | #else |
29 | static inline int mmio_nvram_init(void) | |
30 | { | |
31 | return -ENODEV; | |
32 | } | |
33 | #endif | |
34 | ||
edc79a2f BH |
35 | extern int __init nvram_scan_partitions(void); |
36 | extern loff_t nvram_create_partition(const char *name, int sig, | |
37 | int req_size, int min_size); | |
0f4ac132 JK |
38 | extern int nvram_remove_partition(const char *name, int sig, |
39 | const char *exceptions[]); | |
edc79a2f BH |
40 | extern int nvram_get_partition_size(loff_t data_index); |
41 | extern loff_t nvram_find_partition(const char *name, int sig, int *out_size); | |
42 | ||
1da177e4 LT |
43 | /* Return partition offset in nvram */ |
44 | extern int pmac_get_partition(int partition); | |
45 | ||
46 | /* Direct access to XPRAM on PowerMacs */ | |
47 | extern u8 pmac_xpram_read(int xpaddr); | |
48 | extern void pmac_xpram_write(int xpaddr, u8 data); | |
49 | ||
50 | /* Synchronize NVRAM */ | |
c55377ee PM |
51 | extern void nvram_sync(void); |
52 | ||
d331d830 MW |
53 | /* Determine NVRAM size */ |
54 | extern ssize_t nvram_get_size(void); | |
55 | ||
c55377ee PM |
56 | /* Normal access to NVRAM */ |
57 | extern unsigned char nvram_read_byte(int i); | |
58 | extern void nvram_write_byte(unsigned char c, int i); | |
c55377ee | 59 | #endif /* _ASM_POWERPC_NVRAM_H */ |