diff options
author | Jaroslav Kysela <perex@tm8103> | 2005-11-07 05:02:51 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@tm8103> | 2005-11-07 05:02:51 -0500 |
commit | 1d4ae4a119e5ba711f12b05cdf27f794460add4b (patch) | |
tree | 13a196ce55115d8f64acf0db86314f5abc847b40 /drivers/char | |
parent | c2f2f0fa3829a8da1e029346c4f7e8da82f95d62 (diff) | |
parent | 0b154bb7d0cce80e9c0bcf11d4f9e71b59409d26 (diff) |
Merge with rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/nvram.c | 110 | ||||
-rw-r--r-- | drivers/char/viocons.c | 10 | ||||
-rw-r--r-- | drivers/char/viotape.c | 10 |
3 files changed, 11 insertions, 119 deletions
diff --git a/drivers/char/nvram.c b/drivers/char/nvram.c index 9e24bbd4090c..1af733d07321 100644 --- a/drivers/char/nvram.c +++ b/drivers/char/nvram.c | |||
@@ -32,11 +32,9 @@ | |||
32 | * added changelog | 32 | * added changelog |
33 | * 1.2 Erik Gilling: Cobalt Networks support | 33 | * 1.2 Erik Gilling: Cobalt Networks support |
34 | * Tim Hockin: general cleanup, Cobalt support | 34 | * Tim Hockin: general cleanup, Cobalt support |
35 | * 1.3 Jon Ringle: Comdial MP1000 support | ||
36 | * | ||
37 | */ | 35 | */ |
38 | 36 | ||
39 | #define NVRAM_VERSION "1.3" | 37 | #define NVRAM_VERSION "1.2" |
40 | 38 | ||
41 | #include <linux/module.h> | 39 | #include <linux/module.h> |
42 | #include <linux/config.h> | 40 | #include <linux/config.h> |
@@ -47,7 +45,6 @@ | |||
47 | #define PC 1 | 45 | #define PC 1 |
48 | #define ATARI 2 | 46 | #define ATARI 2 |
49 | #define COBALT 3 | 47 | #define COBALT 3 |
50 | #define MP1000 4 | ||
51 | 48 | ||
52 | /* select machine configuration */ | 49 | /* select machine configuration */ |
53 | #if defined(CONFIG_ATARI) | 50 | #if defined(CONFIG_ATARI) |
@@ -57,9 +54,6 @@ | |||
57 | # if defined(CONFIG_COBALT) | 54 | # if defined(CONFIG_COBALT) |
58 | # include <linux/cobalt-nvram.h> | 55 | # include <linux/cobalt-nvram.h> |
59 | # define MACH COBALT | 56 | # define MACH COBALT |
60 | # elif defined(CONFIG_MACH_MP1000) | ||
61 | # undef MACH | ||
62 | # define MACH MP1000 | ||
63 | # else | 57 | # else |
64 | # define MACH PC | 58 | # define MACH PC |
65 | # endif | 59 | # endif |
@@ -118,23 +112,6 @@ | |||
118 | 112 | ||
119 | #endif | 113 | #endif |
120 | 114 | ||
121 | #if MACH == MP1000 | ||
122 | |||
123 | /* RTC in a MP1000 */ | ||
124 | #define CHECK_DRIVER_INIT() 1 | ||
125 | |||
126 | #define MP1000_CKS_RANGE_START 0 | ||
127 | #define MP1000_CKS_RANGE_END 111 | ||
128 | #define MP1000_CKS_LOC 112 | ||
129 | |||
130 | #define NVRAM_BYTES (128-NVRAM_FIRST_BYTE) | ||
131 | |||
132 | #define mach_check_checksum mp1000_check_checksum | ||
133 | #define mach_set_checksum mp1000_set_checksum | ||
134 | #define mach_proc_infos mp1000_proc_infos | ||
135 | |||
136 | #endif | ||
137 | |||
138 | /* Note that *all* calls to CMOS_READ and CMOS_WRITE must be done with | 115 | /* Note that *all* calls to CMOS_READ and CMOS_WRITE must be done with |
139 | * rtc_lock held. Due to the index-port/data-port design of the RTC, we | 116 | * rtc_lock held. Due to the index-port/data-port design of the RTC, we |
140 | * don't want two different things trying to get to it at once. (e.g. the | 117 | * don't want two different things trying to get to it at once. (e.g. the |
@@ -938,91 +915,6 @@ atari_proc_infos(unsigned char *nvram, char *buffer, int *len, | |||
938 | 915 | ||
939 | #endif /* MACH == ATARI */ | 916 | #endif /* MACH == ATARI */ |
940 | 917 | ||
941 | #if MACH == MP1000 | ||
942 | |||
943 | static int | ||
944 | mp1000_check_checksum(void) | ||
945 | { | ||
946 | int i; | ||
947 | unsigned short sum = 0; | ||
948 | unsigned short expect; | ||
949 | |||
950 | for (i = MP1000_CKS_RANGE_START; i <= MP1000_CKS_RANGE_END; ++i) | ||
951 | sum += __nvram_read_byte(i); | ||
952 | |||
953 | expect = __nvram_read_byte(MP1000_CKS_LOC+1)<<8 | | ||
954 | __nvram_read_byte(MP1000_CKS_LOC); | ||
955 | return ((sum & 0xffff) == expect); | ||
956 | } | ||
957 | |||
958 | static void | ||
959 | mp1000_set_checksum(void) | ||
960 | { | ||
961 | int i; | ||
962 | unsigned short sum = 0; | ||
963 | |||
964 | for (i = MP1000_CKS_RANGE_START; i <= MP1000_CKS_RANGE_END; ++i) | ||
965 | sum += __nvram_read_byte(i); | ||
966 | __nvram_write_byte(sum >> 8, MP1000_CKS_LOC + 1); | ||
967 | __nvram_write_byte(sum & 0xff, MP1000_CKS_LOC); | ||
968 | } | ||
969 | |||
970 | #ifdef CONFIG_PROC_FS | ||
971 | |||
972 | #define SERVER_N_LEN 32 | ||
973 | #define PATH_N_LEN 32 | ||
974 | #define FILE_N_LEN 32 | ||
975 | #define NVRAM_MAGIC_SIG 0xdead | ||
976 | |||
977 | typedef struct NvRamImage | ||
978 | { | ||
979 | unsigned short int magic; | ||
980 | unsigned short int mode; | ||
981 | char fname[FILE_N_LEN]; | ||
982 | char path[PATH_N_LEN]; | ||
983 | char server[SERVER_N_LEN]; | ||
984 | char pad[12]; | ||
985 | } NvRam; | ||
986 | |||
987 | static int | ||
988 | mp1000_proc_infos(unsigned char *nvram, char *buffer, int *len, | ||
989 | off_t *begin, off_t offset, int size) | ||
990 | { | ||
991 | int checksum; | ||
992 | NvRam* nv = (NvRam*)nvram; | ||
993 | |||
994 | spin_lock_irq(&rtc_lock); | ||
995 | checksum = __nvram_check_checksum(); | ||
996 | spin_unlock_irq(&rtc_lock); | ||
997 | |||
998 | PRINT_PROC("Checksum status: %svalid\n", checksum ? "" : "not "); | ||
999 | |||
1000 | switch( nv->mode ) | ||
1001 | { | ||
1002 | case 0 : | ||
1003 | PRINT_PROC( "\tMode 0, tftp prompt\n" ); | ||
1004 | break; | ||
1005 | case 1 : | ||
1006 | PRINT_PROC( "\tMode 1, booting from disk\n" ); | ||
1007 | break; | ||
1008 | case 2 : | ||
1009 | PRINT_PROC( "\tMode 2, Alternate boot from disk /boot/%s\n", nv->fname ); | ||
1010 | break; | ||
1011 | case 3 : | ||
1012 | PRINT_PROC( "\tMode 3, Booting from net:\n" ); | ||
1013 | PRINT_PROC( "\t\t%s:%s%s\n",nv->server, nv->path, nv->fname ); | ||
1014 | break; | ||
1015 | default: | ||
1016 | PRINT_PROC( "\tInconsistant nvram?\n" ); | ||
1017 | break; | ||
1018 | } | ||
1019 | |||
1020 | return 1; | ||
1021 | } | ||
1022 | #endif | ||
1023 | |||
1024 | #endif /* MACH == MP1000 */ | ||
1025 | |||
1026 | MODULE_LICENSE("GPL"); | 918 | MODULE_LICENSE("GPL"); |
1027 | 919 | ||
1028 | EXPORT_SYMBOL(__nvram_read_byte); | 920 | EXPORT_SYMBOL(__nvram_read_byte); |
diff --git a/drivers/char/viocons.c b/drivers/char/viocons.c index 44f5fb4a46ef..98601c7d04a9 100644 --- a/drivers/char/viocons.c +++ b/drivers/char/viocons.c | |||
@@ -44,12 +44,12 @@ | |||
44 | #include <linux/tty_flip.h> | 44 | #include <linux/tty_flip.h> |
45 | #include <linux/sysrq.h> | 45 | #include <linux/sysrq.h> |
46 | 46 | ||
47 | #include <asm/iSeries/vio.h> | 47 | #include <asm/iseries/vio.h> |
48 | 48 | ||
49 | #include <asm/iSeries/HvLpEvent.h> | 49 | #include <asm/iseries/hv_lp_event.h> |
50 | #include <asm/iSeries/HvCallEvent.h> | 50 | #include <asm/iseries/hv_call_event.h> |
51 | #include <asm/iSeries/HvLpConfig.h> | 51 | #include <asm/iseries/hv_lp_config.h> |
52 | #include <asm/iSeries/HvCall.h> | 52 | #include <asm/iseries/hv_call.h> |
53 | 53 | ||
54 | #ifdef CONFIG_VT | 54 | #ifdef CONFIG_VT |
55 | #error You must turn off CONFIG_VT to use CONFIG_VIOCONS | 55 | #error You must turn off CONFIG_VT to use CONFIG_VIOCONS |
diff --git a/drivers/char/viotape.c b/drivers/char/viotape.c index 51abd3defc1c..867cc4e418c7 100644 --- a/drivers/char/viotape.c +++ b/drivers/char/viotape.c | |||
@@ -29,7 +29,7 @@ | |||
29 | * | 29 | * |
30 | * All tape operations are performed by sending messages back and forth to | 30 | * All tape operations are performed by sending messages back and forth to |
31 | * the OS/400 partition. The format of the messages is defined in | 31 | * the OS/400 partition. The format of the messages is defined in |
32 | * iSeries/vio.h | 32 | * iseries/vio.h |
33 | */ | 33 | */ |
34 | #include <linux/config.h> | 34 | #include <linux/config.h> |
35 | #include <linux/version.h> | 35 | #include <linux/version.h> |
@@ -54,10 +54,10 @@ | |||
54 | #include <asm/ioctls.h> | 54 | #include <asm/ioctls.h> |
55 | 55 | ||
56 | #include <asm/vio.h> | 56 | #include <asm/vio.h> |
57 | #include <asm/iSeries/vio.h> | 57 | #include <asm/iseries/vio.h> |
58 | #include <asm/iSeries/HvLpEvent.h> | 58 | #include <asm/iseries/hv_lp_event.h> |
59 | #include <asm/iSeries/HvCallEvent.h> | 59 | #include <asm/iseries/hv_call_event.h> |
60 | #include <asm/iSeries/HvLpConfig.h> | 60 | #include <asm/iseries/hv_lp_config.h> |
61 | 61 | ||
62 | #define VIOTAPE_VERSION "1.2" | 62 | #define VIOTAPE_VERSION "1.2" |
63 | #define VIOTAPE_MAXREQ 1 | 63 | #define VIOTAPE_MAXREQ 1 |