Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Linux-御风守护者
linux
提交
862d32e6
L
linux
项目概览
Linux-御风守护者
/
linux
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
862d32e6
编写于
8月 30, 2011
作者:
S
Stanislaw Gruszka
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
iwlegacy: merge iwl-4965-ucode.c into 4965.c
Signed-off-by:
N
Stanislaw Gruszka
<
sgruszka@redhat.com
>
上级
56e7a8cc
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
126 addition
and
167 deletion
+126
-167
drivers/net/wireless/iwlegacy/4965.c
drivers/net/wireless/iwlegacy/4965.c
+125
-0
drivers/net/wireless/iwlegacy/Makefile
drivers/net/wireless/iwlegacy/Makefile
+1
-1
drivers/net/wireless/iwlegacy/iwl-4965-ucode.c
drivers/net/wireless/iwlegacy/iwl-4965-ucode.c
+0
-166
未找到文件。
drivers/net/wireless/iwlegacy/4965.c
浏览文件 @
862d32e6
...
...
@@ -47,6 +47,131 @@
#include "iwl-4965.h"
#include "iwl-4965-debugfs.h"
#define IL_AC_UNSET -1
/**
* il_verify_inst_sparse - verify runtime uCode image in card vs. host,
* using sample data 100 bytes apart. If these sample points are good,
* it's a pretty good bet that everything between them is good, too.
*/
static
int
il4965_verify_inst_sparse
(
struct
il_priv
*
il
,
__le32
*
image
,
u32
len
)
{
u32
val
;
int
ret
=
0
;
u32
errcnt
=
0
;
u32
i
;
D_INFO
(
"ucode inst image size is %u
\n
"
,
len
);
for
(
i
=
0
;
i
<
len
;
i
+=
100
,
image
+=
100
/
sizeof
(
u32
))
{
/* read data comes through single port, auto-incr addr */
/* NOTE: Use the debugless read so we don't flood kernel log
* if IL_DL_IO is set */
il_wr
(
il
,
HBUS_TARG_MEM_RADDR
,
i
+
IL4965_RTC_INST_LOWER_BOUND
);
val
=
_il_rd
(
il
,
HBUS_TARG_MEM_RDAT
);
if
(
val
!=
le32_to_cpu
(
*
image
))
{
ret
=
-
EIO
;
errcnt
++
;
if
(
errcnt
>=
3
)
break
;
}
}
return
ret
;
}
/**
* il4965_verify_inst_full - verify runtime uCode image in card vs. host,
* looking at all data.
*/
static
int
il4965_verify_inst_full
(
struct
il_priv
*
il
,
__le32
*
image
,
u32
len
)
{
u32
val
;
u32
save_len
=
len
;
int
ret
=
0
;
u32
errcnt
;
D_INFO
(
"ucode inst image size is %u
\n
"
,
len
);
il_wr
(
il
,
HBUS_TARG_MEM_RADDR
,
IL4965_RTC_INST_LOWER_BOUND
);
errcnt
=
0
;
for
(;
len
>
0
;
len
-=
sizeof
(
u32
),
image
++
)
{
/* read data comes through single port, auto-incr addr */
/* NOTE: Use the debugless read so we don't flood kernel log
* if IL_DL_IO is set */
val
=
_il_rd
(
il
,
HBUS_TARG_MEM_RDAT
);
if
(
val
!=
le32_to_cpu
(
*
image
))
{
IL_ERR
(
"uCode INST section is invalid at "
"offset 0x%x, is 0x%x, s/b 0x%x
\n
"
,
save_len
-
len
,
val
,
le32_to_cpu
(
*
image
));
ret
=
-
EIO
;
errcnt
++
;
if
(
errcnt
>=
20
)
break
;
}
}
if
(
!
errcnt
)
D_INFO
(
"ucode image in INSTRUCTION memory is good
\n
"
);
return
ret
;
}
/**
* il4965_verify_ucode - determine which instruction image is in SRAM,
* and verify its contents
*/
int
il4965_verify_ucode
(
struct
il_priv
*
il
)
{
__le32
*
image
;
u32
len
;
int
ret
;
/* Try bootstrap */
image
=
(
__le32
*
)
il
->
ucode_boot
.
v_addr
;
len
=
il
->
ucode_boot
.
len
;
ret
=
il4965_verify_inst_sparse
(
il
,
image
,
len
);
if
(
!
ret
)
{
D_INFO
(
"Bootstrap uCode is good in inst SRAM
\n
"
);
return
0
;
}
/* Try initialize */
image
=
(
__le32
*
)
il
->
ucode_init
.
v_addr
;
len
=
il
->
ucode_init
.
len
;
ret
=
il4965_verify_inst_sparse
(
il
,
image
,
len
);
if
(
!
ret
)
{
D_INFO
(
"Initialize uCode is good in inst SRAM
\n
"
);
return
0
;
}
/* Try runtime/protocol */
image
=
(
__le32
*
)
il
->
ucode_code
.
v_addr
;
len
=
il
->
ucode_code
.
len
;
ret
=
il4965_verify_inst_sparse
(
il
,
image
,
len
);
if
(
!
ret
)
{
D_INFO
(
"Runtime uCode is good in inst SRAM
\n
"
);
return
0
;
}
IL_ERR
(
"NO VALID UCODE IMAGE IN INSTRUCTION SRAM!!
\n
"
);
/* Since nothing seems to match, show first several data entries in
* instruction SRAM, so maybe visual inspection will give a clue.
* Selection of bootstrap image (vs. other images) is arbitrary. */
image
=
(
__le32
*
)
il
->
ucode_boot
.
v_addr
;
len
=
il
->
ucode_boot
.
len
;
ret
=
il4965_verify_inst_full
(
il
,
image
,
len
);
return
ret
;
}
/******************************************************************************
*
* EEPROM related functions
...
...
drivers/net/wireless/iwlegacy/Makefile
浏览文件 @
862d32e6
...
...
@@ -9,7 +9,7 @@ iwl-legacy-objs += $(iwl-legacy-m)
# 4965
obj-$(CONFIG_IWL4965)
+=
iwl4965.o
iwl4965-objs
:=
4965.o 4965-mac.o iwl-4965-rs.o
iwl4965-objs
+=
iwl-4965-
ucode.o iwl-4965-
tx.o
iwl4965-objs
+=
iwl-4965-tx.o
iwl4965-objs
+=
iwl-4965-lib.o iwl-4965-rx.o iwl-4965-calib.o
iwl4965-objs
+=
iwl-4965-sta.o
iwl4965-$(CONFIG_IWLEGACY_DEBUGFS)
+=
iwl-4965-debugfs.o
...
...
drivers/net/wireless/iwlegacy/iwl-4965-ucode.c
已删除
100644 → 0
浏览文件 @
56e7a8cc
/******************************************************************************
*
* GPL LICENSE SUMMARY
*
* Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
* USA
*
* The full GNU General Public License is included in this distribution
* in the file called LICENSE.GPL.
*
* Contact Information:
* Intel Linux Wireless <ilw@linux.intel.com>
* Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*
*****************************************************************************/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/sched.h>
#include "iwl-dev.h"
#include "iwl-core.h"
#include "iwl-io.h"
#include "iwl-helpers.h"
#include "iwl-4965-hw.h"
#include "iwl-4965.h"
#include "iwl-4965-calib.h"
#define IL_AC_UNSET -1
/**
* il_verify_inst_sparse - verify runtime uCode image in card vs. host,
* using sample data 100 bytes apart. If these sample points are good,
* it's a pretty good bet that everything between them is good, too.
*/
static
int
il4965_verify_inst_sparse
(
struct
il_priv
*
il
,
__le32
*
image
,
u32
len
)
{
u32
val
;
int
ret
=
0
;
u32
errcnt
=
0
;
u32
i
;
D_INFO
(
"ucode inst image size is %u
\n
"
,
len
);
for
(
i
=
0
;
i
<
len
;
i
+=
100
,
image
+=
100
/
sizeof
(
u32
))
{
/* read data comes through single port, auto-incr addr */
/* NOTE: Use the debugless read so we don't flood kernel log
* if IL_DL_IO is set */
il_wr
(
il
,
HBUS_TARG_MEM_RADDR
,
i
+
IL4965_RTC_INST_LOWER_BOUND
);
val
=
_il_rd
(
il
,
HBUS_TARG_MEM_RDAT
);
if
(
val
!=
le32_to_cpu
(
*
image
))
{
ret
=
-
EIO
;
errcnt
++
;
if
(
errcnt
>=
3
)
break
;
}
}
return
ret
;
}
/**
* il4965_verify_inst_full - verify runtime uCode image in card vs. host,
* looking at all data.
*/
static
int
il4965_verify_inst_full
(
struct
il_priv
*
il
,
__le32
*
image
,
u32
len
)
{
u32
val
;
u32
save_len
=
len
;
int
ret
=
0
;
u32
errcnt
;
D_INFO
(
"ucode inst image size is %u
\n
"
,
len
);
il_wr
(
il
,
HBUS_TARG_MEM_RADDR
,
IL4965_RTC_INST_LOWER_BOUND
);
errcnt
=
0
;
for
(;
len
>
0
;
len
-=
sizeof
(
u32
),
image
++
)
{
/* read data comes through single port, auto-incr addr */
/* NOTE: Use the debugless read so we don't flood kernel log
* if IL_DL_IO is set */
val
=
_il_rd
(
il
,
HBUS_TARG_MEM_RDAT
);
if
(
val
!=
le32_to_cpu
(
*
image
))
{
IL_ERR
(
"uCode INST section is invalid at "
"offset 0x%x, is 0x%x, s/b 0x%x
\n
"
,
save_len
-
len
,
val
,
le32_to_cpu
(
*
image
));
ret
=
-
EIO
;
errcnt
++
;
if
(
errcnt
>=
20
)
break
;
}
}
if
(
!
errcnt
)
D_INFO
(
"ucode image in INSTRUCTION memory is good
\n
"
);
return
ret
;
}
/**
* il4965_verify_ucode - determine which instruction image is in SRAM,
* and verify its contents
*/
int
il4965_verify_ucode
(
struct
il_priv
*
il
)
{
__le32
*
image
;
u32
len
;
int
ret
;
/* Try bootstrap */
image
=
(
__le32
*
)
il
->
ucode_boot
.
v_addr
;
len
=
il
->
ucode_boot
.
len
;
ret
=
il4965_verify_inst_sparse
(
il
,
image
,
len
);
if
(
!
ret
)
{
D_INFO
(
"Bootstrap uCode is good in inst SRAM
\n
"
);
return
0
;
}
/* Try initialize */
image
=
(
__le32
*
)
il
->
ucode_init
.
v_addr
;
len
=
il
->
ucode_init
.
len
;
ret
=
il4965_verify_inst_sparse
(
il
,
image
,
len
);
if
(
!
ret
)
{
D_INFO
(
"Initialize uCode is good in inst SRAM
\n
"
);
return
0
;
}
/* Try runtime/protocol */
image
=
(
__le32
*
)
il
->
ucode_code
.
v_addr
;
len
=
il
->
ucode_code
.
len
;
ret
=
il4965_verify_inst_sparse
(
il
,
image
,
len
);
if
(
!
ret
)
{
D_INFO
(
"Runtime uCode is good in inst SRAM
\n
"
);
return
0
;
}
IL_ERR
(
"NO VALID UCODE IMAGE IN INSTRUCTION SRAM!!
\n
"
);
/* Since nothing seems to match, show first several data entries in
* instruction SRAM, so maybe visual inspection will give a clue.
* Selection of bootstrap image (vs. other images) is arbitrary. */
image
=
(
__le32
*
)
il
->
ucode_boot
.
v_addr
;
len
=
il
->
ucode_boot
.
len
;
ret
=
il4965_verify_inst_full
(
il
,
image
,
len
);
return
ret
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录