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
bb6a7755
Commit
bb6a7755
authored
Jan 01, 2010
by
David Woodhouse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mtd: nand: rename w90p910_nand.c to nuc900_nand.c
Signed-off-by:
David Woodhouse
<
David.Woodhouse@intel.com
>
parent
49f37b74
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
74 additions
and
74 deletions
+74
-74
drivers/mtd/nand/Kconfig
drivers/mtd/nand/Kconfig
+3
-3
drivers/mtd/nand/Makefile
drivers/mtd/nand/Makefile
+1
-1
drivers/mtd/nand/nuc900_nand.c
drivers/mtd/nand/nuc900_nand.c
+70
-70
No files found.
drivers/mtd/nand/Kconfig
View file @
bb6a7755
...
@@ -489,11 +489,11 @@ config MTD_NAND_SOCRATES
...
@@ -489,11 +489,11 @@ config MTD_NAND_SOCRATES
help
help
Enables support for NAND Flash chips wired onto Socrates board.
Enables support for NAND Flash chips wired onto Socrates board.
config MTD_NAND_
W90P91
0
config MTD_NAND_
NUC90
0
tristate "Support for NAND on
w90p910 evaluation board
."
tristate "Support for NAND on
Nuvoton NUC9xx/w90p910 evaluation boards
."
depends on ARCH_W90X900 && MTD_PARTITIONS
depends on ARCH_W90X900 && MTD_PARTITIONS
help
help
This enables the driver for the NAND Flash on evaluation board based
This enables the driver for the NAND Flash on evaluation board based
on w90p910.
on w90p910
/ NUC9xx
.
endif # MTD_NAND
endif # MTD_NAND
drivers/mtd/nand/Makefile
View file @
bb6a7755
...
@@ -40,7 +40,7 @@ obj-$(CONFIG_MTD_NAND_SH_FLCTL) += sh_flctl.o
...
@@ -40,7 +40,7 @@ obj-$(CONFIG_MTD_NAND_SH_FLCTL) += sh_flctl.o
obj-$(CONFIG_MTD_NAND_MXC)
+=
mxc_nand.o
obj-$(CONFIG_MTD_NAND_MXC)
+=
mxc_nand.o
obj-$(CONFIG_MTD_NAND_SOCRATES)
+=
socrates_nand.o
obj-$(CONFIG_MTD_NAND_SOCRATES)
+=
socrates_nand.o
obj-$(CONFIG_MTD_NAND_TXX9NDFMC)
+=
txx9ndfmc.o
obj-$(CONFIG_MTD_NAND_TXX9NDFMC)
+=
txx9ndfmc.o
obj-$(CONFIG_MTD_NAND_
W90P910)
+=
w90p91
0_nand.o
obj-$(CONFIG_MTD_NAND_
NUC900)
+=
nuc90
0_nand.o
obj-$(CONFIG_MTD_NAND_NOMADIK)
+=
nomadik_nand.o
obj-$(CONFIG_MTD_NAND_NOMADIK)
+=
nomadik_nand.o
obj-$(CONFIG_MTD_NAND_BCM_UMI)
+=
bcm_umi_nand.o nand_bcm_umi.o
obj-$(CONFIG_MTD_NAND_BCM_UMI)
+=
bcm_umi_nand.o nand_bcm_umi.o
...
...
drivers/mtd/nand/
w90p91
0_nand.c
→
drivers/mtd/nand/
nuc90
0_nand.c
View file @
bb6a7755
/*
/*
* Copyright
(c)
2009 Nuvoton technology corporation.
* Copyright
©
2009 Nuvoton technology corporation.
*
*
* Wan ZongShun <mcuos.com@gmail.com>
* Wan ZongShun <mcuos.com@gmail.com>
*
*
...
@@ -55,7 +55,7 @@
...
@@ -55,7 +55,7 @@
#define write_addr_reg(dev, val) \
#define write_addr_reg(dev, val) \
__raw_writel((val), (dev)->reg + REG_SMADDR)
__raw_writel((val), (dev)->reg + REG_SMADDR)
struct
w90p91
0_nand
{
struct
nuc90
0_nand
{
struct
mtd_info
mtd
;
struct
mtd_info
mtd
;
struct
nand_chip
chip
;
struct
nand_chip
chip
;
void
__iomem
*
reg
;
void
__iomem
*
reg
;
...
@@ -76,49 +76,49 @@ static const struct mtd_partition partitions[] = {
...
@@ -76,49 +76,49 @@ static const struct mtd_partition partitions[] = {
}
}
};
};
static
unsigned
char
w90p91
0_nand_read_byte
(
struct
mtd_info
*
mtd
)
static
unsigned
char
nuc90
0_nand_read_byte
(
struct
mtd_info
*
mtd
)
{
{
unsigned
char
ret
;
unsigned
char
ret
;
struct
w90p91
0_nand
*
nand
;
struct
nuc90
0_nand
*
nand
;
nand
=
container_of
(
mtd
,
struct
w90p91
0_nand
,
mtd
);
nand
=
container_of
(
mtd
,
struct
nuc90
0_nand
,
mtd
);
ret
=
(
unsigned
char
)
read_data_reg
(
nand
);
ret
=
(
unsigned
char
)
read_data_reg
(
nand
);
return
ret
;
return
ret
;
}
}
static
void
w90p91
0_nand_read_buf
(
struct
mtd_info
*
mtd
,
static
void
nuc90
0_nand_read_buf
(
struct
mtd_info
*
mtd
,
unsigned
char
*
buf
,
int
len
)
unsigned
char
*
buf
,
int
len
)
{
{
int
i
;
int
i
;
struct
w90p91
0_nand
*
nand
;
struct
nuc90
0_nand
*
nand
;
nand
=
container_of
(
mtd
,
struct
w90p91
0_nand
,
mtd
);
nand
=
container_of
(
mtd
,
struct
nuc90
0_nand
,
mtd
);
for
(
i
=
0
;
i
<
len
;
i
++
)
for
(
i
=
0
;
i
<
len
;
i
++
)
buf
[
i
]
=
(
unsigned
char
)
read_data_reg
(
nand
);
buf
[
i
]
=
(
unsigned
char
)
read_data_reg
(
nand
);
}
}
static
void
w90p91
0_nand_write_buf
(
struct
mtd_info
*
mtd
,
static
void
nuc90
0_nand_write_buf
(
struct
mtd_info
*
mtd
,
const
unsigned
char
*
buf
,
int
len
)
const
unsigned
char
*
buf
,
int
len
)
{
{
int
i
;
int
i
;
struct
w90p91
0_nand
*
nand
;
struct
nuc90
0_nand
*
nand
;
nand
=
container_of
(
mtd
,
struct
w90p91
0_nand
,
mtd
);
nand
=
container_of
(
mtd
,
struct
nuc90
0_nand
,
mtd
);
for
(
i
=
0
;
i
<
len
;
i
++
)
for
(
i
=
0
;
i
<
len
;
i
++
)
write_data_reg
(
nand
,
buf
[
i
]);
write_data_reg
(
nand
,
buf
[
i
]);
}
}
static
int
w90p91
0_verify_buf
(
struct
mtd_info
*
mtd
,
static
int
nuc90
0_verify_buf
(
struct
mtd_info
*
mtd
,
const
unsigned
char
*
buf
,
int
len
)
const
unsigned
char
*
buf
,
int
len
)
{
{
int
i
;
int
i
;
struct
w90p91
0_nand
*
nand
;
struct
nuc90
0_nand
*
nand
;
nand
=
container_of
(
mtd
,
struct
w90p91
0_nand
,
mtd
);
nand
=
container_of
(
mtd
,
struct
nuc90
0_nand
,
mtd
);
for
(
i
=
0
;
i
<
len
;
i
++
)
{
for
(
i
=
0
;
i
<
len
;
i
++
)
{
if
(
buf
[
i
]
!=
(
unsigned
char
)
read_data_reg
(
nand
))
if
(
buf
[
i
]
!=
(
unsigned
char
)
read_data_reg
(
nand
))
...
@@ -128,7 +128,7 @@ static int w90p910_verify_buf(struct mtd_info *mtd,
...
@@ -128,7 +128,7 @@ static int w90p910_verify_buf(struct mtd_info *mtd,
return
0
;
return
0
;
}
}
static
int
w90p910_check_rb
(
struct
w90p91
0_nand
*
nand
)
static
int
nuc900_check_rb
(
struct
nuc90
0_nand
*
nand
)
{
{
unsigned
int
val
;
unsigned
int
val
;
spin_lock
(
&
nand
->
lock
);
spin_lock
(
&
nand
->
lock
);
...
@@ -139,24 +139,24 @@ static int w90p910_check_rb(struct w90p910_nand *nand)
...
@@ -139,24 +139,24 @@ static int w90p910_check_rb(struct w90p910_nand *nand)
return
val
;
return
val
;
}
}
static
int
w90p91
0_nand_devready
(
struct
mtd_info
*
mtd
)
static
int
nuc90
0_nand_devready
(
struct
mtd_info
*
mtd
)
{
{
struct
w90p91
0_nand
*
nand
;
struct
nuc90
0_nand
*
nand
;
int
ready
;
int
ready
;
nand
=
container_of
(
mtd
,
struct
w90p91
0_nand
,
mtd
);
nand
=
container_of
(
mtd
,
struct
nuc90
0_nand
,
mtd
);
ready
=
(
w90p91
0_check_rb
(
nand
))
?
1
:
0
;
ready
=
(
nuc90
0_check_rb
(
nand
))
?
1
:
0
;
return
ready
;
return
ready
;
}
}
static
void
w90p910_nand_command_lp
(
struct
mtd_info
*
mt
d
,
static
void
nuc900_nand_command_lp
(
struct
mtd_info
*
mtd
,
unsigned
int
comman
d
,
unsigned
int
command
,
int
column
,
int
page_addr
)
int
column
,
int
page_addr
)
{
{
register
struct
nand_chip
*
chip
=
mtd
->
priv
;
register
struct
nand_chip
*
chip
=
mtd
->
priv
;
struct
w90p91
0_nand
*
nand
;
struct
nuc90
0_nand
*
nand
;
nand
=
container_of
(
mtd
,
struct
w90p91
0_nand
,
mtd
);
nand
=
container_of
(
mtd
,
struct
nuc90
0_nand
,
mtd
);
if
(
command
==
NAND_CMD_READOOB
)
{
if
(
command
==
NAND_CMD_READOOB
)
{
column
+=
mtd
->
writesize
;
column
+=
mtd
->
writesize
;
...
@@ -212,7 +212,7 @@ static void w90p910_nand_command_lp(struct mtd_info *mtd,
...
@@ -212,7 +212,7 @@ static void w90p910_nand_command_lp(struct mtd_info *mtd,
write_cmd_reg
(
nand
,
NAND_CMD_STATUS
);
write_cmd_reg
(
nand
,
NAND_CMD_STATUS
);
write_cmd_reg
(
nand
,
command
);
write_cmd_reg
(
nand
,
command
);
while
(
!
w90p91
0_check_rb
(
nand
))
while
(
!
nuc90
0_check_rb
(
nand
))
;
;
return
;
return
;
...
@@ -241,7 +241,7 @@ static void w90p910_nand_command_lp(struct mtd_info *mtd,
...
@@ -241,7 +241,7 @@ static void w90p910_nand_command_lp(struct mtd_info *mtd,
}
}
static
void
w90p910_nand_enable
(
struct
w90p91
0_nand
*
nand
)
static
void
nuc900_nand_enable
(
struct
nuc90
0_nand
*
nand
)
{
{
unsigned
int
val
;
unsigned
int
val
;
spin_lock
(
&
nand
->
lock
);
spin_lock
(
&
nand
->
lock
);
...
@@ -262,37 +262,37 @@ static void w90p910_nand_enable(struct w90p910_nand *nand)
...
@@ -262,37 +262,37 @@ static void w90p910_nand_enable(struct w90p910_nand *nand)
spin_unlock
(
&
nand
->
lock
);
spin_unlock
(
&
nand
->
lock
);
}
}
static
int
__devinit
w90p91
0_nand_probe
(
struct
platform_device
*
pdev
)
static
int
__devinit
nuc90
0_nand_probe
(
struct
platform_device
*
pdev
)
{
{
struct
w90p910_nand
*
w90p91
0_nand
;
struct
nuc900_nand
*
nuc90
0_nand
;
struct
nand_chip
*
chip
;
struct
nand_chip
*
chip
;
int
retval
;
int
retval
;
struct
resource
*
res
;
struct
resource
*
res
;
retval
=
0
;
retval
=
0
;
w90p910_nand
=
kzalloc
(
sizeof
(
struct
w90p91
0_nand
),
GFP_KERNEL
);
nuc900_nand
=
kzalloc
(
sizeof
(
struct
nuc90
0_nand
),
GFP_KERNEL
);
if
(
!
w90p91
0_nand
)
if
(
!
nuc90
0_nand
)
return
-
ENOMEM
;
return
-
ENOMEM
;
chip
=
&
(
w90p91
0_nand
->
chip
);
chip
=
&
(
nuc90
0_nand
->
chip
);
w90p91
0_nand
->
mtd
.
priv
=
chip
;
nuc90
0_nand
->
mtd
.
priv
=
chip
;
w90p91
0_nand
->
mtd
.
owner
=
THIS_MODULE
;
nuc90
0_nand
->
mtd
.
owner
=
THIS_MODULE
;
spin_lock_init
(
&
w90p91
0_nand
->
lock
);
spin_lock_init
(
&
nuc90
0_nand
->
lock
);
w90p91
0_nand
->
clk
=
clk_get
(
&
pdev
->
dev
,
NULL
);
nuc90
0_nand
->
clk
=
clk_get
(
&
pdev
->
dev
,
NULL
);
if
(
IS_ERR
(
w90p91
0_nand
->
clk
))
{
if
(
IS_ERR
(
nuc90
0_nand
->
clk
))
{
retval
=
-
ENOENT
;
retval
=
-
ENOENT
;
goto
fail1
;
goto
fail1
;
}
}
clk_enable
(
w90p91
0_nand
->
clk
);
clk_enable
(
nuc90
0_nand
->
clk
);
chip
->
cmdfunc
=
w90p91
0_nand_command_lp
;
chip
->
cmdfunc
=
nuc90
0_nand_command_lp
;
chip
->
dev_ready
=
w90p91
0_nand_devready
;
chip
->
dev_ready
=
nuc90
0_nand_devready
;
chip
->
read_byte
=
w90p91
0_nand_read_byte
;
chip
->
read_byte
=
nuc90
0_nand_read_byte
;
chip
->
write_buf
=
w90p91
0_nand_write_buf
;
chip
->
write_buf
=
nuc90
0_nand_write_buf
;
chip
->
read_buf
=
w90p91
0_nand_read_buf
;
chip
->
read_buf
=
nuc90
0_nand_read_buf
;
chip
->
verify_buf
=
w90p91
0_verify_buf
;
chip
->
verify_buf
=
nuc90
0_verify_buf
;
chip
->
chip_delay
=
50
;
chip
->
chip_delay
=
50
;
chip
->
options
=
0
;
chip
->
options
=
0
;
chip
->
ecc
.
mode
=
NAND_ECC_SOFT
;
chip
->
ecc
.
mode
=
NAND_ECC_SOFT
;
...
@@ -308,75 +308,75 @@ static int __devinit w90p910_nand_probe(struct platform_device *pdev)
...
@@ -308,75 +308,75 @@ static int __devinit w90p910_nand_probe(struct platform_device *pdev)
goto
fail1
;
goto
fail1
;
}
}
w90p91
0_nand
->
reg
=
ioremap
(
res
->
start
,
resource_size
(
res
));
nuc90
0_nand
->
reg
=
ioremap
(
res
->
start
,
resource_size
(
res
));
if
(
!
w90p91
0_nand
->
reg
)
{
if
(
!
nuc90
0_nand
->
reg
)
{
retval
=
-
ENOMEM
;
retval
=
-
ENOMEM
;
goto
fail2
;
goto
fail2
;
}
}
w90p910_nand_enable
(
w90p91
0_nand
);
nuc900_nand_enable
(
nuc90
0_nand
);
if
(
nand_scan
(
&
(
w90p91
0_nand
->
mtd
),
1
))
{
if
(
nand_scan
(
&
(
nuc90
0_nand
->
mtd
),
1
))
{
retval
=
-
ENXIO
;
retval
=
-
ENXIO
;
goto
fail3
;
goto
fail3
;
}
}
add_mtd_partitions
(
&
(
w90p91
0_nand
->
mtd
),
partitions
,
add_mtd_partitions
(
&
(
nuc90
0_nand
->
mtd
),
partitions
,
ARRAY_SIZE
(
partitions
));
ARRAY_SIZE
(
partitions
));
platform_set_drvdata
(
pdev
,
w90p91
0_nand
);
platform_set_drvdata
(
pdev
,
nuc90
0_nand
);
return
retval
;
return
retval
;
fail3:
iounmap
(
w90p91
0_nand
->
reg
);
fail3:
iounmap
(
nuc90
0_nand
->
reg
);
fail2:
release_mem_region
(
res
->
start
,
resource_size
(
res
));
fail2:
release_mem_region
(
res
->
start
,
resource_size
(
res
));
fail1:
kfree
(
w90p91
0_nand
);
fail1:
kfree
(
nuc90
0_nand
);
return
retval
;
return
retval
;
}
}
static
int
__devexit
w90p91
0_nand_remove
(
struct
platform_device
*
pdev
)
static
int
__devexit
nuc90
0_nand_remove
(
struct
platform_device
*
pdev
)
{
{
struct
w90p910_nand
*
w90p91
0_nand
=
platform_get_drvdata
(
pdev
);
struct
nuc900_nand
*
nuc90
0_nand
=
platform_get_drvdata
(
pdev
);
struct
resource
*
res
;
struct
resource
*
res
;
iounmap
(
w90p91
0_nand
->
reg
);
iounmap
(
nuc90
0_nand
->
reg
);
res
=
platform_get_resource
(
pdev
,
IORESOURCE_MEM
,
0
);
res
=
platform_get_resource
(
pdev
,
IORESOURCE_MEM
,
0
);
release_mem_region
(
res
->
start
,
resource_size
(
res
));
release_mem_region
(
res
->
start
,
resource_size
(
res
));
clk_disable
(
w90p91
0_nand
->
clk
);
clk_disable
(
nuc90
0_nand
->
clk
);
clk_put
(
w90p91
0_nand
->
clk
);
clk_put
(
nuc90
0_nand
->
clk
);
kfree
(
w90p91
0_nand
);
kfree
(
nuc90
0_nand
);
platform_set_drvdata
(
pdev
,
NULL
);
platform_set_drvdata
(
pdev
,
NULL
);
return
0
;
return
0
;
}
}
static
struct
platform_driver
w90p91
0_nand_driver
=
{
static
struct
platform_driver
nuc90
0_nand_driver
=
{
.
probe
=
w90p91
0_nand_probe
,
.
probe
=
nuc90
0_nand_probe
,
.
remove
=
__devexit_p
(
w90p91
0_nand_remove
),
.
remove
=
__devexit_p
(
nuc90
0_nand_remove
),
.
driver
=
{
.
driver
=
{
.
name
=
"nuc900-fmi"
,
.
name
=
"nuc900-fmi"
,
.
owner
=
THIS_MODULE
,
.
owner
=
THIS_MODULE
,
},
},
};
};
static
int
__init
w90p91
0_nand_init
(
void
)
static
int
__init
nuc90
0_nand_init
(
void
)
{
{
return
platform_driver_register
(
&
w90p91
0_nand_driver
);
return
platform_driver_register
(
&
nuc90
0_nand_driver
);
}
}
static
void
__exit
w90p91
0_nand_exit
(
void
)
static
void
__exit
nuc90
0_nand_exit
(
void
)
{
{
platform_driver_unregister
(
&
w90p91
0_nand_driver
);
platform_driver_unregister
(
&
nuc90
0_nand_driver
);
}
}
module_init
(
w90p91
0_nand_init
);
module_init
(
nuc90
0_nand_init
);
module_exit
(
w90p91
0_nand_exit
);
module_exit
(
nuc90
0_nand_exit
);
MODULE_AUTHOR
(
"Wan ZongShun <mcuos.com@gmail.com>"
);
MODULE_AUTHOR
(
"Wan ZongShun <mcuos.com@gmail.com>"
);
MODULE_DESCRIPTION
(
"w90p910 nand driver!"
);
MODULE_DESCRIPTION
(
"w90p910
/NUC9xx
nand driver!"
);
MODULE_LICENSE
(
"GPL"
);
MODULE_LICENSE
(
"GPL"
);
MODULE_ALIAS
(
"platform:nuc900-fmi"
);
MODULE_ALIAS
(
"platform:nuc900-fmi"
);
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