Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
866237ea
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
866237ea
编写于
11月 04, 2005
作者:
R
Russell King
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[PATCH] ARM: Reverted 2921/1: Support for the RTC / nvram on the Comdial MP1000
No longer maintained
上级
e399822d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
1 addition
and
109 deletion
+1
-109
drivers/char/nvram.c
drivers/char/nvram.c
+1
-109
未找到文件。
drivers/char/nvram.c
浏览文件 @
866237ea
...
...
@@ -32,11 +32,9 @@
* added changelog
* 1.2 Erik Gilling: Cobalt Networks support
* Tim Hockin: general cleanup, Cobalt support
* 1.3 Jon Ringle: Comdial MP1000 support
*
*/
#define NVRAM_VERSION "1.
3
"
#define NVRAM_VERSION "1.
2
"
#include <linux/module.h>
#include <linux/config.h>
...
...
@@ -47,7 +45,6 @@
#define PC 1
#define ATARI 2
#define COBALT 3
#define MP1000 4
/* select machine configuration */
#if defined(CONFIG_ATARI)
...
...
@@ -57,9 +54,6 @@
# if defined(CONFIG_COBALT)
# include <linux/cobalt-nvram.h>
# define MACH COBALT
# elif defined(CONFIG_MACH_MP1000)
# undef MACH
# define MACH MP1000
# else
# define MACH PC
# endif
...
...
@@ -118,23 +112,6 @@
#endif
#if MACH == MP1000
/* RTC in a MP1000 */
#define CHECK_DRIVER_INIT() 1
#define MP1000_CKS_RANGE_START 0
#define MP1000_CKS_RANGE_END 111
#define MP1000_CKS_LOC 112
#define NVRAM_BYTES (128-NVRAM_FIRST_BYTE)
#define mach_check_checksum mp1000_check_checksum
#define mach_set_checksum mp1000_set_checksum
#define mach_proc_infos mp1000_proc_infos
#endif
/* Note that *all* calls to CMOS_READ and CMOS_WRITE must be done with
* rtc_lock held. Due to the index-port/data-port design of the RTC, we
* 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,
#endif
/* MACH == ATARI */
#if MACH == MP1000
static
int
mp1000_check_checksum
(
void
)
{
int
i
;
unsigned
short
sum
=
0
;
unsigned
short
expect
;
for
(
i
=
MP1000_CKS_RANGE_START
;
i
<=
MP1000_CKS_RANGE_END
;
++
i
)
sum
+=
__nvram_read_byte
(
i
);
expect
=
__nvram_read_byte
(
MP1000_CKS_LOC
+
1
)
<<
8
|
__nvram_read_byte
(
MP1000_CKS_LOC
);
return
((
sum
&
0xffff
)
==
expect
);
}
static
void
mp1000_set_checksum
(
void
)
{
int
i
;
unsigned
short
sum
=
0
;
for
(
i
=
MP1000_CKS_RANGE_START
;
i
<=
MP1000_CKS_RANGE_END
;
++
i
)
sum
+=
__nvram_read_byte
(
i
);
__nvram_write_byte
(
sum
>>
8
,
MP1000_CKS_LOC
+
1
);
__nvram_write_byte
(
sum
&
0xff
,
MP1000_CKS_LOC
);
}
#ifdef CONFIG_PROC_FS
#define SERVER_N_LEN 32
#define PATH_N_LEN 32
#define FILE_N_LEN 32
#define NVRAM_MAGIC_SIG 0xdead
typedef
struct
NvRamImage
{
unsigned
short
int
magic
;
unsigned
short
int
mode
;
char
fname
[
FILE_N_LEN
];
char
path
[
PATH_N_LEN
];
char
server
[
SERVER_N_LEN
];
char
pad
[
12
];
}
NvRam
;
static
int
mp1000_proc_infos
(
unsigned
char
*
nvram
,
char
*
buffer
,
int
*
len
,
off_t
*
begin
,
off_t
offset
,
int
size
)
{
int
checksum
;
NvRam
*
nv
=
(
NvRam
*
)
nvram
;
spin_lock_irq
(
&
rtc_lock
);
checksum
=
__nvram_check_checksum
();
spin_unlock_irq
(
&
rtc_lock
);
PRINT_PROC
(
"Checksum status: %svalid
\n
"
,
checksum
?
""
:
"not "
);
switch
(
nv
->
mode
)
{
case
0
:
PRINT_PROC
(
"
\t
Mode 0, tftp prompt
\n
"
);
break
;
case
1
:
PRINT_PROC
(
"
\t
Mode 1, booting from disk
\n
"
);
break
;
case
2
:
PRINT_PROC
(
"
\t
Mode 2, Alternate boot from disk /boot/%s
\n
"
,
nv
->
fname
);
break
;
case
3
:
PRINT_PROC
(
"
\t
Mode 3, Booting from net:
\n
"
);
PRINT_PROC
(
"
\t\t
%s:%s%s
\n
"
,
nv
->
server
,
nv
->
path
,
nv
->
fname
);
break
;
default:
PRINT_PROC
(
"
\t
Inconsistant nvram?
\n
"
);
break
;
}
return
1
;
}
#endif
#endif
/* MACH == MP1000 */
MODULE_LICENSE
(
"GPL"
);
EXPORT_SYMBOL
(
__nvram_read_byte
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录