diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-07-29 00:45:24 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-11-29 23:09:19 -0500 |
commit | 74d51d029818eca9d1aec22dd2895e269c0044b1 (patch) | |
tree | d3b40889e9d046c3af216b49253de0af10a39050 /arch | |
parent | f2e785ed5fb8e5fe5063ee2ba1c8f150396c53c6 (diff) |
powerpc/nvram: Move things out of asm/nvram.h
This moves a bunch of definitions out of asm/nvram.h to the files
that use them or just outright remove completely unused stuff.
We leave the partition signatures definitions, they will be useful
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/include/asm/nvram.h | 42 | ||||
-rw-r--r-- | arch/powerpc/kernel/nvram_64.c | 21 | ||||
-rw-r--r-- | arch/powerpc/platforms/chrp/time.c | 4 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/nvram.c | 2 |
4 files changed, 28 insertions, 41 deletions
diff --git a/arch/powerpc/include/asm/nvram.h b/arch/powerpc/include/asm/nvram.h index 850b72f27445..459dc09ecbd8 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,25 +25,11 @@ | |||
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 { | ||
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, | 33 | extern int nvram_write_error_log(char * buff, int length, |
72 | unsigned int err_type, unsigned int err_seq); | 34 | unsigned int err_type, unsigned int err_seq); |
73 | extern int nvram_read_error_log(char * buff, int length, | 35 | extern int nvram_read_error_log(char * buff, int length, |
diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c index 9cf197f01e94..a8154f1813df 100644 --- a/arch/powerpc/kernel/nvram_64.c +++ b/arch/powerpc/kernel/nvram_64.c | |||
@@ -34,6 +34,25 @@ | |||
34 | 34 | ||
35 | #undef DEBUG_NVRAM | 35 | #undef DEBUG_NVRAM |
36 | 36 | ||
37 | #define NVRAM_HEADER_LEN 16 /* sizeof(struct nvram_header) */ | ||
38 | #define NVRAM_BLOCK_LEN 16 | ||
39 | #define NVRAM_MAX_REQ (2080/NVRAM_BLOCK_LEN) | ||
40 | #define NVRAM_MIN_REQ (1056/NVRAM_BLOCK_LEN) | ||
41 | |||
42 | /* If change this size, then change the size of NVNAME_LEN */ | ||
43 | struct nvram_header { | ||
44 | unsigned char signature; | ||
45 | unsigned char checksum; | ||
46 | unsigned short length; | ||
47 | char name[12]; | ||
48 | }; | ||
49 | |||
50 | struct nvram_partition { | ||
51 | struct list_head partition; | ||
52 | struct nvram_header header; | ||
53 | unsigned int index; | ||
54 | }; | ||
55 | |||
37 | static struct nvram_partition * nvram_part; | 56 | static struct nvram_partition * nvram_part; |
38 | static long nvram_error_log_index = -1; | 57 | static long nvram_error_log_index = -1; |
39 | static long nvram_error_log_size = 0; | 58 | static long nvram_error_log_size = 0; |
@@ -432,7 +451,7 @@ static int __init nvram_setup_partition(void) | |||
432 | } | 451 | } |
433 | 452 | ||
434 | /* try creating a partition with the free space we have */ | 453 | /* try creating a partition with the free space we have */ |
435 | rc = nvram_create_os_partition(); | 454 | rc = nvram_create_partition("ppc64,linux", ); |
436 | if (!rc) { | 455 | if (!rc) { |
437 | return 0; | 456 | return 0; |
438 | } | 457 | } |
diff --git a/arch/powerpc/platforms/chrp/time.c b/arch/powerpc/platforms/chrp/time.c index 054dfe5b8e77..f803f4b8ab6f 100644 --- a/arch/powerpc/platforms/chrp/time.c +++ b/arch/powerpc/platforms/chrp/time.c | |||
@@ -29,6 +29,10 @@ | |||
29 | 29 | ||
30 | extern spinlock_t rtc_lock; | 30 | extern spinlock_t rtc_lock; |
31 | 31 | ||
32 | #define NVRAM_AS0 0x74 | ||
33 | #define NVRAM_AS1 0x75 | ||
34 | #define NVRAM_DATA 0x77 | ||
35 | |||
32 | static int nvram_as1 = NVRAM_AS1; | 36 | static int nvram_as1 = NVRAM_AS1; |
33 | static int nvram_as0 = NVRAM_AS0; | 37 | static int nvram_as0 = NVRAM_AS0; |
34 | static int nvram_data = NVRAM_DATA; | 38 | static int nvram_data = NVRAM_DATA; |
diff --git a/arch/powerpc/platforms/pseries/nvram.c b/arch/powerpc/platforms/pseries/nvram.c index bc3c7f2abd79..f4e4c06284b4 100644 --- a/arch/powerpc/platforms/pseries/nvram.c +++ b/arch/powerpc/platforms/pseries/nvram.c | |||
@@ -27,6 +27,8 @@ static int nvram_fetch, nvram_store; | |||
27 | static char nvram_buf[NVRW_CNT]; /* assume this is in the first 4GB */ | 27 | static char nvram_buf[NVRW_CNT]; /* assume this is in the first 4GB */ |
28 | static DEFINE_SPINLOCK(nvram_lock); | 28 | static DEFINE_SPINLOCK(nvram_lock); |
29 | 29 | ||
30 | /* Max bytes to read/write in one go */ | ||
31 | #define NVRW_CNT 0x20 | ||
30 | 32 | ||
31 | static ssize_t pSeries_nvram_read(char *buf, size_t count, loff_t *index) | 33 | static ssize_t pSeries_nvram_read(char *buf, size_t count, loff_t *index) |
32 | { | 34 | { |