Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
019e2574
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
158
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
019e2574
编写于
6月 02, 2010
作者:
P
Paul Mundt
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'sh/iomap'
上级
4705b2e8
861160bf
变更
15
显示空白变更内容
内联
并排
Showing
15 changed file
with
99 addition
and
75 deletion
+99
-75
arch/sh/Kconfig
arch/sh/Kconfig
+4
-1
arch/sh/boards/Kconfig
arch/sh/boards/Kconfig
+3
-0
arch/sh/include/asm/io.h
arch/sh/include/asm/io.h
+8
-0
arch/sh/include/asm/machvec.h
arch/sh/include/asm/machvec.h
+5
-4
arch/sh/kernel/Makefile
arch/sh/kernel/Makefile
+2
-1
arch/sh/kernel/io.c
arch/sh/kernel/io.c
+0
-22
arch/sh/kernel/io_generic.c
arch/sh/kernel/io_generic.c
+20
-0
arch/sh/kernel/io_trapped.c
arch/sh/kernel/io_trapped.c
+4
-0
arch/sh/kernel/machvec.c
arch/sh/kernel/machvec.c
+11
-6
drivers/input/serio/Kconfig
drivers/input/serio/Kconfig
+2
-1
drivers/usb/gadget/m66592-udc.h
drivers/usb/gadget/m66592-udc.h
+11
-11
drivers/usb/gadget/r8a66597-udc.c
drivers/usb/gadget/r8a66597-udc.c
+2
-2
drivers/usb/gadget/r8a66597-udc.h
drivers/usb/gadget/r8a66597-udc.h
+12
-12
drivers/usb/host/r8a66597-hcd.c
drivers/usb/host/r8a66597-hcd.c
+2
-2
drivers/usb/host/r8a66597.h
drivers/usb/host/r8a66597.h
+13
-13
未找到文件。
arch/sh/Kconfig
浏览文件 @
019e2574
...
...
@@ -9,7 +9,7 @@ config SUPERH
def_bool y
select EMBEDDED
select HAVE_CLK
select HAVE_IDE
select HAVE_IDE
if HAS_IOPORT
select HAVE_LMB
select HAVE_OPROFILE
select HAVE_GENERIC_DMA_COHERENT
...
...
@@ -174,6 +174,9 @@ config ARCH_HAS_DEFAULT_IDLE
config ARCH_HAS_CPU_IDLE_WAIT
def_bool y
config NO_IOPORT
bool
config IO_TRAPPED
bool
...
...
arch/sh/boards/Kconfig
浏览文件 @
019e2574
...
...
@@ -154,6 +154,7 @@ config SH_SDK7786
bool "SDK7786"
depends on CPU_SUBTYPE_SH7786
select SYS_SUPPORTS_PCI
select NO_IOPORT if !PCI
help
Select SDK7786 if configuring for a Renesas Technology Europe
SH7786-65nm board.
...
...
@@ -190,6 +191,7 @@ config SH_URQUELL
depends on CPU_SUBTYPE_SH7786
select ARCH_REQUIRE_GPIOLIB
select SYS_SUPPORTS_PCI
select NO_IOPORT if !PCI
config SH_MIGOR
bool "Migo-R"
...
...
@@ -286,6 +288,7 @@ config SH_LBOX_RE2
config SH_X3PROTO
bool "SH-X3 Prototype board"
depends on CPU_SUBTYPE_SHX3
select NO_IOPORT if !PCI
config SH_MAGIC_PANEL_R2
bool "Magic Panel R2"
...
...
arch/sh/include/asm/io.h
浏览文件 @
019e2574
...
...
@@ -39,6 +39,8 @@
#include <asm/io_generic.h>
#include <asm/io_trapped.h>
#ifdef CONFIG_HAS_IOPORT
#define inb(p) sh_mv.mv_inb((p))
#define inw(p) sh_mv.mv_inw((p))
#define inl(p) sh_mv.mv_inl((p))
...
...
@@ -60,6 +62,8 @@
#define outsw(p,b,c) sh_mv.mv_outsw((p), (b), (c))
#define outsl(p,b,c) sh_mv.mv_outsl((p), (b), (c))
#endif
#define __raw_writeb(v,a) (__chk_io_ptr(a), *(volatile u8 __force *)(a) = (v))
#define __raw_writew(v,a) (__chk_io_ptr(a), *(volatile u16 __force *)(a) = (v))
#define __raw_writel(v,a) (__chk_io_ptr(a), *(volatile u32 __force *)(a) = (v))
...
...
@@ -240,6 +244,8 @@ __BUILD_MEMORY_STRING(q, u64)
#define IO_SPACE_LIMIT 0xffffffff
#ifdef CONFIG_HAS_IOPORT
/*
* This function provides a method for the generic case where a
* board-specific ioport_map simply needs to return the port + some
...
...
@@ -255,6 +261,8 @@ static inline void __set_io_port_base(unsigned long pbase)
#define __ioport_map(p, n) sh_mv.mv_ioport_map((p), (n))
#endif
/* We really want to try and get these to memcpy etc */
void
memcpy_fromio
(
void
*
,
const
volatile
void
__iomem
*
,
unsigned
long
);
void
memcpy_toio
(
volatile
void
__iomem
*
,
const
void
*
,
unsigned
long
);
...
...
arch/sh/include/asm/machvec.h
浏览文件 @
019e2574
...
...
@@ -19,6 +19,10 @@ struct sh_machine_vector {
const
char
*
mv_name
;
int
mv_nr_irqs
;
int
(
*
mv_irq_demux
)(
int
irq
);
void
(
*
mv_init_irq
)(
void
);
#ifdef CONFIG_HAS_IOPORT
u8
(
*
mv_inb
)(
unsigned
long
);
u16
(
*
mv_inw
)(
unsigned
long
);
u32
(
*
mv_inl
)(
unsigned
long
);
...
...
@@ -40,12 +44,9 @@ struct sh_machine_vector {
void
(
*
mv_outsw
)(
unsigned
long
,
const
void
*
src
,
unsigned
long
count
);
void
(
*
mv_outsl
)(
unsigned
long
,
const
void
*
src
,
unsigned
long
count
);
int
(
*
mv_irq_demux
)(
int
irq
);
void
(
*
mv_init_irq
)(
void
);
void
__iomem
*
(
*
mv_ioport_map
)(
unsigned
long
port
,
unsigned
int
size
);
void
(
*
mv_ioport_unmap
)(
void
__iomem
*
);
#endif
int
(
*
mv_clk_init
)(
void
);
int
(
*
mv_mode_pins
)(
void
);
...
...
arch/sh/kernel/Makefile
浏览文件 @
019e2574
...
...
@@ -12,7 +12,7 @@ endif
CFLAGS_REMOVE_return_address.o
=
-pg
obj-y
:=
clkdev.o debugtraps.o dma-nommu.o dumpstack.o
\
idle.o io.o i
o_generic.o irq.o
\
idle.o io.o i
rq.o
\
irq_
$(BITS)
.o machvec.o nmi_debug.o process.o
\
process_
$(BITS)
.o ptrace_
$(BITS)
.o
\
reboot.o return_address.o
\
...
...
@@ -39,6 +39,7 @@ obj-$(CONFIG_DUMP_CODE) += disassemble.o
obj-$(CONFIG_HIBERNATION)
+=
swsusp.o
obj-$(CONFIG_DWARF_UNWINDER)
+=
dwarf.o
obj-$(CONFIG_PERF_EVENTS)
+=
perf_event.o perf_callchain.o
obj-$(CONFIG_HAS_IOPORT)
+=
io_generic.o
obj-$(CONFIG_HAVE_HW_BREAKPOINT)
+=
hw_breakpoint.o
obj-$(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST)
+=
localtimer.o
...
...
arch/sh/kernel/io.c
浏览文件 @
019e2574
...
...
@@ -112,25 +112,3 @@ void memset_io(volatile void __iomem *dst, int c, unsigned long count)
}
}
EXPORT_SYMBOL
(
memset_io
);
#ifndef CONFIG_GENERIC_IOMAP
void
__iomem
*
ioport_map
(
unsigned
long
port
,
unsigned
int
nr
)
{
void
__iomem
*
ret
;
ret
=
__ioport_map_trapped
(
port
,
nr
);
if
(
ret
)
return
ret
;
return
__ioport_map
(
port
,
nr
);
}
EXPORT_SYMBOL
(
ioport_map
);
void
ioport_unmap
(
void
__iomem
*
addr
)
{
sh_mv
.
mv_ioport_unmap
(
addr
);
}
EXPORT_SYMBOL
(
ioport_unmap
);
#endif
/* CONFIG_GENERIC_IOMAP */
arch/sh/kernel/io_generic.c
浏览文件 @
019e2574
...
...
@@ -158,3 +158,23 @@ void __iomem *generic_ioport_map(unsigned long addr, unsigned int size)
void
generic_ioport_unmap
(
void
__iomem
*
addr
)
{
}
#ifndef CONFIG_GENERIC_IOMAP
void
__iomem
*
ioport_map
(
unsigned
long
port
,
unsigned
int
nr
)
{
void
__iomem
*
ret
;
ret
=
__ioport_map_trapped
(
port
,
nr
);
if
(
ret
)
return
ret
;
return
__ioport_map
(
port
,
nr
);
}
EXPORT_SYMBOL
(
ioport_map
);
void
ioport_unmap
(
void
__iomem
*
addr
)
{
sh_mv
.
mv_ioport_unmap
(
addr
);
}
EXPORT_SYMBOL
(
ioport_unmap
);
#endif
/* CONFIG_GENERIC_IOMAP */
arch/sh/kernel/io_trapped.c
浏览文件 @
019e2574
...
...
@@ -91,10 +91,14 @@ int register_trapped_io(struct trapped_io *tiop)
tiop
->
magic
=
IO_TRAPPED_MAGIC
;
INIT_LIST_HEAD
(
&
tiop
->
list
);
spin_lock_irq
(
&
trapped_lock
);
#ifdef CONFIG_HAS_IOPORT
if
(
flags
&
IORESOURCE_IO
)
list_add
(
&
tiop
->
list
,
&
trapped_io
);
#endif
#ifdef CONFIG_HAS_IOMEM
if
(
flags
&
IORESOURCE_MEM
)
list_add
(
&
tiop
->
list
,
&
trapped_mem
);
#endif
spin_unlock_irq
(
&
trapped_lock
);
return
0
;
...
...
arch/sh/kernel/machvec.c
浏览文件 @
019e2574
...
...
@@ -118,6 +118,14 @@ void __init sh_mv_setup(void)
sh_mv.mv_##elem = generic_##elem; \
} while (0)
#ifdef CONFIG_HAS_IOPORT
#ifdef P2SEG
__set_io_port_base
(
P2SEG
);
#else
__set_io_port_base
(
0
);
#endif
mv_set
(
inb
);
mv_set
(
inw
);
mv_set
(
inl
);
mv_set
(
outb
);
mv_set
(
outw
);
mv_set
(
outl
);
...
...
@@ -129,16 +137,13 @@ void __init sh_mv_setup(void)
mv_set
(
ioport_map
);
mv_set
(
ioport_unmap
);
#endif
mv_set
(
irq_demux
);
mv_set
(
mode_pins
);
mv_set
(
mem_init
);
if
(
!
sh_mv
.
mv_nr_irqs
)
sh_mv
.
mv_nr_irqs
=
NR_IRQS
;
#ifdef P2SEG
__set_io_port_base
(
P2SEG
);
#else
__set_io_port_base
(
0
);
#endif
}
drivers/input/serio/Kconfig
浏览文件 @
019e2574
...
...
@@ -21,7 +21,8 @@ if SERIO
config SERIO_I8042
tristate "i8042 PC Keyboard controller" if EMBEDDED || !X86
default y
depends on !PARISC && (!ARM || ARCH_SHARK || FOOTBRIDGE_HOST) && !M68K && !BLACKFIN
depends on !PARISC && (!ARM || ARCH_SHARK || FOOTBRIDGE_HOST) && \
(!SUPERH || SH_CAYMAN) && !M68K && !BLACKFIN
help
i8042 is the chip over which the standard AT keyboard and PS/2
mouse are connected to the computer. If you use these devices,
...
...
drivers/usb/gadget/m66592-udc.h
浏览文件 @
019e2574
...
...
@@ -537,35 +537,35 @@ struct m66592 {
/*-------------------------------------------------------------------------*/
static
inline
u16
m66592_read
(
struct
m66592
*
m66592
,
unsigned
long
offset
)
{
return
i
nw
((
unsigned
long
)
m66592
->
reg
+
offset
);
return
i
oread16
(
m66592
->
reg
+
offset
);
}
static
inline
void
m66592_read_fifo
(
struct
m66592
*
m66592
,
unsigned
long
offset
,
void
*
buf
,
unsigned
long
len
)
{
unsigned
long
fifoaddr
=
(
unsigned
long
)
m66592
->
reg
+
offset
;
void
__iomem
*
fifoaddr
=
m66592
->
reg
+
offset
;
if
(
m66592
->
pdata
->
on_chip
)
{
len
=
(
len
+
3
)
/
4
;
i
nsl
(
fifoaddr
,
buf
,
len
);
i
oread32_rep
(
fifoaddr
,
buf
,
len
);
}
else
{
len
=
(
len
+
1
)
/
2
;
i
nsw
(
fifoaddr
,
buf
,
len
);
i
oread16_rep
(
fifoaddr
,
buf
,
len
);
}
}
static
inline
void
m66592_write
(
struct
m66592
*
m66592
,
u16
val
,
unsigned
long
offset
)
{
outw
(
val
,
(
unsigned
long
)
m66592
->
reg
+
offset
);
iowrite16
(
val
,
m66592
->
reg
+
offset
);
}
static
inline
void
m66592_write_fifo
(
struct
m66592
*
m66592
,
unsigned
long
offset
,
void
*
buf
,
unsigned
long
len
)
{
unsigned
long
fifoaddr
=
(
unsigned
long
)
m66592
->
reg
+
offset
;
void
__iomem
*
fifoaddr
=
m66592
->
reg
+
offset
;
if
(
m66592
->
pdata
->
on_chip
)
{
unsigned
long
count
;
...
...
@@ -573,25 +573,25 @@ static inline void m66592_write_fifo(struct m66592 *m66592,
int
i
;
count
=
len
/
4
;
outsl
(
fifoaddr
,
buf
,
count
);
iowrite32_rep
(
fifoaddr
,
buf
,
count
);
if
(
len
&
0x00000003
)
{
pb
=
buf
+
count
*
4
;
for
(
i
=
0
;
i
<
(
len
&
0x00000003
);
i
++
)
{
if
(
m66592_read
(
m66592
,
M66592_CFBCFG
))
/* le */
outb
(
pb
[
i
],
fifoaddr
+
(
3
-
i
));
iowrite8
(
pb
[
i
],
fifoaddr
+
(
3
-
i
));
else
outb
(
pb
[
i
],
fifoaddr
+
i
);
iowrite8
(
pb
[
i
],
fifoaddr
+
i
);
}
}
}
else
{
unsigned
long
odd
=
len
&
0x0001
;
len
=
len
/
2
;
outsw
(
fifoaddr
,
buf
,
len
);
iowrite16_rep
(
fifoaddr
,
buf
,
len
);
if
(
odd
)
{
unsigned
char
*
p
=
buf
+
len
*
2
;
outb
(
*
p
,
fifoaddr
);
iowrite8
(
*
p
,
fifoaddr
);
}
}
}
...
...
drivers/usb/gadget/r8a66597-udc.c
浏览文件 @
019e2574
...
...
@@ -1500,7 +1500,7 @@ static int __exit r8a66597_remove(struct platform_device *pdev)
struct
r8a66597
*
r8a66597
=
dev_get_drvdata
(
&
pdev
->
dev
);
del_timer_sync
(
&
r8a66597
->
timer
);
iounmap
(
(
void
*
)
r8a66597
->
reg
);
iounmap
(
r8a66597
->
reg
);
free_irq
(
platform_get_irq
(
pdev
,
0
),
r8a66597
);
r8a66597_free_request
(
&
r8a66597
->
ep
[
0
].
ep
,
r8a66597
->
ep0_req
);
#ifdef CONFIG_HAVE_CLK
...
...
@@ -1578,7 +1578,7 @@ static int __init r8a66597_probe(struct platform_device *pdev)
init_timer
(
&
r8a66597
->
timer
);
r8a66597
->
timer
.
function
=
r8a66597_timer
;
r8a66597
->
timer
.
data
=
(
unsigned
long
)
r8a66597
;
r8a66597
->
reg
=
(
unsigned
long
)
reg
;
r8a66597
->
reg
=
reg
;
#ifdef CONFIG_HAVE_CLK
if
(
r8a66597
->
pdata
->
on_chip
)
{
...
...
drivers/usb/gadget/r8a66597-udc.h
浏览文件 @
019e2574
...
...
@@ -91,7 +91,7 @@ struct r8a66597_ep {
struct
r8a66597
{
spinlock_t
lock
;
unsigned
long
reg
;
void
__iomem
*
reg
;
#ifdef CONFIG_HAVE_CLK
struct
clk
*
clk
;
...
...
@@ -127,7 +127,7 @@ struct r8a66597 {
static
inline
u16
r8a66597_read
(
struct
r8a66597
*
r8a66597
,
unsigned
long
offset
)
{
return
i
nw
(
r8a66597
->
reg
+
offset
);
return
i
oread16
(
r8a66597
->
reg
+
offset
);
}
static
inline
void
r8a66597_read_fifo
(
struct
r8a66597
*
r8a66597
,
...
...
@@ -135,7 +135,7 @@ static inline void r8a66597_read_fifo(struct r8a66597 *r8a66597,
unsigned
char
*
buf
,
int
len
)
{
unsigned
long
fifoaddr
=
r8a66597
->
reg
+
offset
;
void
__iomem
*
fifoaddr
=
r8a66597
->
reg
+
offset
;
unsigned
int
data
;
int
i
;
...
...
@@ -144,7 +144,7 @@ static inline void r8a66597_read_fifo(struct r8a66597 *r8a66597,
/* aligned buf case */
if
(
len
>=
4
&&
!
((
unsigned
long
)
buf
&
0x03
))
{
i
nsl
(
fifoaddr
,
buf
,
len
/
4
);
i
oread32_rep
(
fifoaddr
,
buf
,
len
/
4
);
buf
+=
len
&
~
0x03
;
len
&=
0x03
;
}
...
...
@@ -152,7 +152,7 @@ static inline void r8a66597_read_fifo(struct r8a66597 *r8a66597,
/* unaligned buf case */
for
(
i
=
0
;
i
<
len
;
i
++
)
{
if
(
!
(
i
&
0x03
))
data
=
i
nl
(
fifoaddr
);
data
=
i
oread32
(
fifoaddr
);
buf
[
i
]
=
(
data
>>
((
i
&
0x03
)
*
8
))
&
0xff
;
}
...
...
@@ -161,7 +161,7 @@ static inline void r8a66597_read_fifo(struct r8a66597 *r8a66597,
/* aligned buf case */
if
(
len
>=
2
&&
!
((
unsigned
long
)
buf
&
0x01
))
{
i
nsw
(
fifoaddr
,
buf
,
len
/
2
);
i
oread16_rep
(
fifoaddr
,
buf
,
len
/
2
);
buf
+=
len
&
~
0x01
;
len
&=
0x01
;
}
...
...
@@ -169,7 +169,7 @@ static inline void r8a66597_read_fifo(struct r8a66597 *r8a66597,
/* unaligned buf case */
for
(
i
=
0
;
i
<
len
;
i
++
)
{
if
(
!
(
i
&
0x01
))
data
=
i
nw
(
fifoaddr
);
data
=
i
oread16
(
fifoaddr
);
buf
[
i
]
=
(
data
>>
((
i
&
0x01
)
*
8
))
&
0xff
;
}
...
...
@@ -179,7 +179,7 @@ static inline void r8a66597_read_fifo(struct r8a66597 *r8a66597,
static
inline
void
r8a66597_write
(
struct
r8a66597
*
r8a66597
,
u16
val
,
unsigned
long
offset
)
{
outw
(
val
,
r8a66597
->
reg
+
offset
);
iowrite16
(
val
,
r8a66597
->
reg
+
offset
);
}
static
inline
void
r8a66597_write_fifo
(
struct
r8a66597
*
r8a66597
,
...
...
@@ -187,21 +187,21 @@ static inline void r8a66597_write_fifo(struct r8a66597 *r8a66597,
unsigned
char
*
buf
,
int
len
)
{
unsigned
long
fifoaddr
=
r8a66597
->
reg
+
offset
;
void
__iomem
*
fifoaddr
=
r8a66597
->
reg
+
offset
;
int
adj
=
0
;
int
i
;
if
(
r8a66597
->
pdata
->
on_chip
)
{
/* 32-bit access only if buf is 32-bit aligned */
if
(
len
>=
4
&&
!
((
unsigned
long
)
buf
&
0x03
))
{
outsl
(
fifoaddr
,
buf
,
len
/
4
);
iowrite32_rep
(
fifoaddr
,
buf
,
len
/
4
);
buf
+=
len
&
~
0x03
;
len
&=
0x03
;
}
}
else
{
/* 16-bit access only if buf is 16-bit aligned */
if
(
len
>=
2
&&
!
((
unsigned
long
)
buf
&
0x01
))
{
outsw
(
fifoaddr
,
buf
,
len
/
2
);
iowrite16_rep
(
fifoaddr
,
buf
,
len
/
2
);
buf
+=
len
&
~
0x01
;
len
&=
0x01
;
}
...
...
@@ -216,7 +216,7 @@ static inline void r8a66597_write_fifo(struct r8a66597 *r8a66597,
}
for
(
i
=
0
;
i
<
len
;
i
++
)
outb
(
buf
[
i
],
fifoaddr
+
adj
-
(
i
&
adj
));
iowrite8
(
buf
[
i
],
fifoaddr
+
adj
-
(
i
&
adj
));
}
static
inline
void
r8a66597_mdfy
(
struct
r8a66597
*
r8a66597
,
...
...
drivers/usb/host/r8a66597-hcd.c
浏览文件 @
019e2574
...
...
@@ -2404,7 +2404,7 @@ static int __init_or_module r8a66597_remove(struct platform_device *pdev)
del_timer_sync
(
&
r8a66597
->
rh_timer
);
usb_remove_hcd
(
hcd
);
iounmap
(
(
void
*
)
r8a66597
->
reg
);
iounmap
(
r8a66597
->
reg
);
#ifdef CONFIG_HAVE_CLK
if
(
r8a66597
->
pdata
->
on_chip
)
clk_put
(
r8a66597
->
clk
);
...
...
@@ -2496,7 +2496,7 @@ static int __devinit r8a66597_probe(struct platform_device *pdev)
init_timer
(
&
r8a66597
->
rh_timer
);
r8a66597
->
rh_timer
.
function
=
r8a66597_timer
;
r8a66597
->
rh_timer
.
data
=
(
unsigned
long
)
r8a66597
;
r8a66597
->
reg
=
(
unsigned
long
)
reg
;
r8a66597
->
reg
=
reg
;
/* make sure no interrupts are pending */
ret
=
r8a66597_clock_enable
(
r8a66597
);
...
...
drivers/usb/host/r8a66597.h
浏览文件 @
019e2574
...
...
@@ -112,7 +112,7 @@ struct r8a66597_root_hub {
struct
r8a66597
{
spinlock_t
lock
;
unsigned
long
reg
;
void
__iomem
*
reg
;
#ifdef CONFIG_HAVE_CLK
struct
clk
*
clk
;
#endif
...
...
@@ -170,67 +170,67 @@ static inline struct urb *r8a66597_get_urb(struct r8a66597 *r8a66597,
static
inline
u16
r8a66597_read
(
struct
r8a66597
*
r8a66597
,
unsigned
long
offset
)
{
return
i
nw
(
r8a66597
->
reg
+
offset
);
return
i
oread16
(
r8a66597
->
reg
+
offset
);
}
static
inline
void
r8a66597_read_fifo
(
struct
r8a66597
*
r8a66597
,
unsigned
long
offset
,
u16
*
buf
,
int
len
)
{
unsigned
long
fifoaddr
=
r8a66597
->
reg
+
offset
;
void
__iomem
*
fifoaddr
=
r8a66597
->
reg
+
offset
;
unsigned
long
count
;
if
(
r8a66597
->
pdata
->
on_chip
)
{
count
=
len
/
4
;
i
nsl
(
fifoaddr
,
buf
,
count
);
i
oread32_rep
(
fifoaddr
,
buf
,
count
);
if
(
len
&
0x00000003
)
{
unsigned
long
tmp
=
i
nl
(
fifoaddr
);
unsigned
long
tmp
=
i
oread32
(
fifoaddr
);
memcpy
((
unsigned
char
*
)
buf
+
count
*
4
,
&
tmp
,
len
&
0x03
);
}
}
else
{
len
=
(
len
+
1
)
/
2
;
i
nsw
(
fifoaddr
,
buf
,
len
);
i
oread16_rep
(
fifoaddr
,
buf
,
len
);
}
}
static
inline
void
r8a66597_write
(
struct
r8a66597
*
r8a66597
,
u16
val
,
unsigned
long
offset
)
{
outw
(
val
,
r8a66597
->
reg
+
offset
);
iowrite16
(
val
,
r8a66597
->
reg
+
offset
);
}
static
inline
void
r8a66597_write_fifo
(
struct
r8a66597
*
r8a66597
,
unsigned
long
offset
,
u16
*
buf
,
int
len
)
{
unsigned
long
fifoaddr
=
r8a66597
->
reg
+
offset
;
void
__iomem
*
fifoaddr
=
r8a66597
->
reg
+
offset
;
unsigned
long
count
;
unsigned
char
*
pb
;
int
i
;
if
(
r8a66597
->
pdata
->
on_chip
)
{
count
=
len
/
4
;
outsl
(
fifoaddr
,
buf
,
count
);
iowrite32_rep
(
fifoaddr
,
buf
,
count
);
if
(
len
&
0x00000003
)
{
pb
=
(
unsigned
char
*
)
buf
+
count
*
4
;
for
(
i
=
0
;
i
<
(
len
&
0x00000003
);
i
++
)
{
if
(
r8a66597_read
(
r8a66597
,
CFIFOSEL
)
&
BIGEND
)
outb
(
pb
[
i
],
fifoaddr
+
i
);
iowrite8
(
pb
[
i
],
fifoaddr
+
i
);
else
outb
(
pb
[
i
],
fifoaddr
+
3
-
i
);
iowrite8
(
pb
[
i
],
fifoaddr
+
3
-
i
);
}
}
}
else
{
int
odd
=
len
&
0x0001
;
len
=
len
/
2
;
outsw
(
fifoaddr
,
buf
,
len
);
ioread16_rep
(
fifoaddr
,
buf
,
len
);
if
(
unlikely
(
odd
))
{
buf
=
&
buf
[
len
];
outb
((
unsigned
char
)
*
buf
,
fifoaddr
);
iowrite8
((
unsigned
char
)
*
buf
,
fifoaddr
);
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录