Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
e98403d7
Commit
e98403d7
authored
Sep 11, 2004
by
Linus Torvalds
Committed by
Linus Torvalds
Sep 11, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix up and annotate MTD map usage of PCI memory access
parent
48eed47a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
21 deletions
+19
-21
drivers/mtd/maps/amd76xrom.c
drivers/mtd/maps/amd76xrom.c
+7
-8
drivers/mtd/maps/ceiva.c
drivers/mtd/maps/ceiva.c
+2
-2
drivers/mtd/maps/sa1100-flash.c
drivers/mtd/maps/sa1100-flash.c
+2
-2
drivers/mtd/maps/tqm8xxl.c
drivers/mtd/maps/tqm8xxl.c
+4
-4
drivers/mtd/maps/uclinux.c
drivers/mtd/maps/uclinux.c
+3
-4
include/linux/mtd/map.h
include/linux/mtd/map.h
+1
-1
No files found.
drivers/mtd/maps/amd76xrom.c
View file @
e98403d7
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
struct
amd76xrom_map_info
{
struct
amd76xrom_map_info
{
struct
map_info
map
;
struct
map_info
map
;
struct
mtd_info
*
mtd
;
struct
mtd_info
*
mtd
;
unsigned
long
window_addr
;
void
__iomem
*
window_addr
;
u32
window_start
,
window_size
;
u32
window_start
,
window_size
;
struct
pci_dev
*
pdev
;
struct
pci_dev
*
pdev
;
struct
resource
window_rsrc
;
struct
resource
window_rsrc
;
...
@@ -57,7 +57,7 @@ static void amd76xrom_cleanup(struct amd76xrom_map_info *info)
...
@@ -57,7 +57,7 @@ static void amd76xrom_cleanup(struct amd76xrom_map_info *info)
del_mtd_device
(
info
->
mtd
);
del_mtd_device
(
info
->
mtd
);
map_destroy
(
info
->
mtd
);
map_destroy
(
info
->
mtd
);
info
->
mtd
=
NULL
;
info
->
mtd
=
NULL
;
info
->
map
.
virt
=
0
;
info
->
map
.
virt
=
NULL
;
}
}
if
(
info
->
rom_rsrc
.
parent
)
if
(
info
->
rom_rsrc
.
parent
)
release_resource
(
&
info
->
rom_rsrc
);
release_resource
(
&
info
->
rom_rsrc
);
...
@@ -65,8 +65,8 @@ static void amd76xrom_cleanup(struct amd76xrom_map_info *info)
...
@@ -65,8 +65,8 @@ static void amd76xrom_cleanup(struct amd76xrom_map_info *info)
release_resource
(
&
info
->
window_rsrc
);
release_resource
(
&
info
->
window_rsrc
);
if
(
info
->
window_addr
)
{
if
(
info
->
window_addr
)
{
iounmap
(
(
void
*
)(
info
->
window_addr
)
);
iounmap
(
info
->
window_addr
);
info
->
window_addr
=
0
;
info
->
window_addr
=
NULL
;
}
}
}
}
...
@@ -136,8 +136,7 @@ static int __devinit amd76xrom_init_one (struct pci_dev *pdev,
...
@@ -136,8 +136,7 @@ static int __devinit amd76xrom_init_one (struct pci_dev *pdev,
printk
(
KERN_NOTICE
MOD_NAME
" window : %x at %x
\n
"
,
printk
(
KERN_NOTICE
MOD_NAME
" window : %x at %x
\n
"
,
window
->
size
,
window
->
start
);
window
->
size
,
window
->
start
);
/* For write accesses caches are useless */
/* For write accesses caches are useless */
info
->
window_addr
=
info
->
window_addr
=
ioremap_nocache
(
window
->
start
,
(
unsigned
long
)
ioremap_nocache
(
window
->
start
,
window
->
size
);
window
->
size
);
if
(
!
info
->
window_addr
)
{
if
(
!
info
->
window_addr
)
{
...
@@ -163,8 +162,8 @@ static int __devinit amd76xrom_init_one (struct pci_dev *pdev,
...
@@ -163,8 +162,8 @@ static int __devinit amd76xrom_init_one (struct pci_dev *pdev,
}
}
if
(
info
->
mtd
)
goto
found_mtd
;
if
(
info
->
mtd
)
goto
found_mtd
;
}
}
iounmap
(
(
void
*
)(
info
->
window_addr
)
);
iounmap
(
info
->
window_addr
);
info
->
window_addr
=
0
;
info
->
window_addr
=
NULL
;
/* Disable writes through the rom window */
/* Disable writes through the rom window */
pci_read_config_byte
(
pdev
,
0x40
,
&
byte
);
pci_read_config_byte
(
pdev
,
0x40
,
&
byte
);
...
...
drivers/mtd/maps/ceiva.c
View file @
e98403d7
...
@@ -103,7 +103,7 @@ struct clps_info {
...
@@ -103,7 +103,7 @@ struct clps_info {
unsigned
long
base
;
unsigned
long
base
;
unsigned
long
size
;
unsigned
long
size
;
int
width
;
int
width
;
void
*
vbase
;
void
__iomem
*
vbase
;
struct
map_info
*
map
;
struct
map_info
*
map
;
struct
mtd_info
*
mtd
;
struct
mtd_info
*
mtd
;
struct
resource
*
res
;
struct
resource
*
res
;
...
@@ -150,7 +150,7 @@ static int __init clps_setup_mtd(struct clps_info *clps, int nr, struct mtd_info
...
@@ -150,7 +150,7 @@ static int __init clps_setup_mtd(struct clps_info *clps, int nr, struct mtd_info
break
;
break
;
}
}
clps
[
i
].
map
->
virt
=
(
unsigned
long
)
clps
[
i
].
vbase
;
clps
[
i
].
map
->
virt
=
clps
[
i
].
vbase
;
clps
[
i
].
map
->
bankwidth
=
clps
[
i
].
width
;
clps
[
i
].
map
->
bankwidth
=
clps
[
i
].
width
;
clps
[
i
].
map
->
size
=
clps
[
i
].
size
;
clps
[
i
].
map
->
size
=
clps
[
i
].
size
;
...
...
drivers/mtd/maps/sa1100-flash.c
View file @
e98403d7
...
@@ -885,7 +885,7 @@ struct sa_info {
...
@@ -885,7 +885,7 @@ struct sa_info {
unsigned
long
base
;
unsigned
long
base
;
unsigned
long
size
;
unsigned
long
size
;
int
width
;
int
width
;
void
*
vbase
;
void
__iomem
*
vbase
;
void
(
*
set_vpp
)(
struct
map_info
*
,
int
);
void
(
*
set_vpp
)(
struct
map_info
*
,
int
);
struct
map_info
*
map
;
struct
map_info
*
map
;
struct
mtd_info
*
mtd
;
struct
mtd_info
*
mtd
;
...
@@ -932,7 +932,7 @@ static int __init sa1100_setup_mtd(struct sa_info *sa, int nr, struct mtd_info *
...
@@ -932,7 +932,7 @@ static int __init sa1100_setup_mtd(struct sa_info *sa, int nr, struct mtd_info *
break
;
break
;
}
}
sa
[
i
].
map
->
virt
=
(
unsigned
long
)
sa
[
i
].
vbase
;
sa
[
i
].
map
->
virt
=
sa
[
i
].
vbase
;
sa
[
i
].
map
->
phys
=
sa
[
i
].
base
;
sa
[
i
].
map
->
phys
=
sa
[
i
].
base
;
sa
[
i
].
map
->
set_vpp
=
sa
[
i
].
set_vpp
;
sa
[
i
].
map
->
set_vpp
=
sa
[
i
].
set_vpp
;
sa
[
i
].
map
->
bankwidth
=
sa
[
i
].
width
;
sa
[
i
].
map
->
bankwidth
=
sa
[
i
].
width
;
...
...
drivers/mtd/maps/tqm8xxl.c
View file @
e98403d7
...
@@ -50,7 +50,7 @@ static struct mtd_info* mtd_banks[FLASH_BANK_MAX];
...
@@ -50,7 +50,7 @@ static struct mtd_info* mtd_banks[FLASH_BANK_MAX];
static
struct
map_info
*
map_banks
[
FLASH_BANK_MAX
];
static
struct
map_info
*
map_banks
[
FLASH_BANK_MAX
];
static
struct
mtd_part_def
part_banks
[
FLASH_BANK_MAX
];
static
struct
mtd_part_def
part_banks
[
FLASH_BANK_MAX
];
static
unsigned
long
num_banks
;
static
unsigned
long
num_banks
;
static
unsigned
long
start_scan_addr
;
static
void
__iomem
*
start_scan_addr
;
/*
/*
* Here are partition information for all known TQM8xxL series devices.
* Here are partition information for all known TQM8xxL series devices.
...
@@ -121,7 +121,7 @@ int __init init_tqm_mtd(void)
...
@@ -121,7 +121,7 @@ int __init init_tqm_mtd(void)
flash_size
=
bd
->
bi_flashsize
;
flash_size
=
bd
->
bi_flashsize
;
//request maximum flash size address space
//request maximum flash size address space
start_scan_addr
=
(
unsigned
long
)
ioremap
(
flash_addr
,
flash_size
);
start_scan_addr
=
ioremap
(
flash_addr
,
flash_size
);
if
(
!
start_scan_addr
)
{
if
(
!
start_scan_addr
)
{
printk
(
KERN_WARNING
"%s:Failed to ioremap address:0x%x
\n
"
,
__FUNCTION__
,
flash_addr
);
printk
(
KERN_WARNING
"%s:Failed to ioremap address:0x%x
\n
"
,
__FUNCTION__
,
flash_addr
);
return
-
EIO
;
return
-
EIO
;
...
@@ -231,7 +231,7 @@ int __init init_tqm_mtd(void)
...
@@ -231,7 +231,7 @@ int __init init_tqm_mtd(void)
}
}
}
}
error:
error:
iounmap
(
(
void
*
)
start_scan_addr
);
iounmap
(
start_scan_addr
);
return
ret
;
return
ret
;
}
}
...
@@ -250,7 +250,7 @@ static void __exit cleanup_tqm_mtd(void)
...
@@ -250,7 +250,7 @@ static void __exit cleanup_tqm_mtd(void)
}
}
if
(
start_scan_addr
)
{
if
(
start_scan_addr
)
{
iounmap
(
(
void
*
)
start_scan_addr
);
iounmap
(
start_scan_addr
);
start_scan_addr
=
0
;
start_scan_addr
=
0
;
}
}
}
}
...
...
drivers/mtd/maps/uclinux.c
View file @
e98403d7
...
@@ -69,10 +69,9 @@ int __init uclinux_mtd_init(void)
...
@@ -69,10 +69,9 @@ int __init uclinux_mtd_init(void)
printk
(
"uclinux[mtd]: RAM probe address=0x%x size=0x%x
\n
"
,
printk
(
"uclinux[mtd]: RAM probe address=0x%x size=0x%x
\n
"
,
(
int
)
mapp
->
map_priv_2
,
(
int
)
mapp
->
size
);
(
int
)
mapp
->
map_priv_2
,
(
int
)
mapp
->
size
);
mapp
->
virt
=
(
unsigned
long
)
mapp
->
virt
=
ioremap_nocache
(
mapp
->
phys
,
mapp
->
size
);
ioremap_nocache
(
mapp
->
phys
,
mapp
->
size
);
if
(
mapp
->
virt
==
0
)
{
if
(
!
mapp
->
virt
)
{
printk
(
"uclinux[mtd]: ioremap_nocache() failed
\n
"
);
printk
(
"uclinux[mtd]: ioremap_nocache() failed
\n
"
);
return
(
-
EIO
);
return
(
-
EIO
);
}
}
...
@@ -82,7 +81,7 @@ int __init uclinux_mtd_init(void)
...
@@ -82,7 +81,7 @@ int __init uclinux_mtd_init(void)
mtd
=
do_map_probe
(
"map_ram"
,
mapp
);
mtd
=
do_map_probe
(
"map_ram"
,
mapp
);
if
(
!
mtd
)
{
if
(
!
mtd
)
{
printk
(
"uclinux[mtd]: failed to find a mapping?
\n
"
);
printk
(
"uclinux[mtd]: failed to find a mapping?
\n
"
);
iounmap
(
(
void
*
)
mapp
->
virt
);
iounmap
(
mapp
->
virt
);
return
(
-
ENXIO
);
return
(
-
ENXIO
);
}
}
...
...
include/linux/mtd/map.h
View file @
e98403d7
...
@@ -179,7 +179,7 @@ struct map_info {
...
@@ -179,7 +179,7 @@ struct map_info {
unsigned
long
phys
;
unsigned
long
phys
;
#define NO_XIP (-1UL)
#define NO_XIP (-1UL)
unsigned
long
virt
;
void
__iomem
*
virt
;
void
*
cached
;
void
*
cached
;
int
bankwidth
;
/* in octets. This isn't necessarily the width
int
bankwidth
;
/* in octets. This isn't necessarily the width
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment