Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
u-boot-2015.04
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vesta
u-boot-2015.04
Commits
1a23a197
Commit
1a23a197
authored
16 years ago
by
Scott Wood
Browse files
Options
Downloads
Patches
Plain Diff
s3c24x0: Update NAND driver to new API.
Signed-off-by:
Scott Wood
<
scottwood@freescale.com
>
parent
aa5f75f2
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cpu/arm920t/s3c24x0/nand.c
+32
-32
32 additions, 32 deletions
cpu/arm920t/s3c24x0/nand.c
with
32 additions
and
32 deletions
cpu/arm920t/s3c24x0/nand.c
+
32
−
32
View file @
1a23a197
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
#include
<nand.h>
#include
<nand.h>
#include
<s3c2410.h>
#include
<s3c2410.h>
#include
<asm/io.h>
#define __REGb(x) (*(volatile unsigned char *)(x))
#define __REGb(x) (*(volatile unsigned char *)(x))
#define __REGi(x) (*(volatile unsigned int *)(x))
#define __REGi(x) (*(volatile unsigned int *)(x))
...
@@ -54,34 +55,33 @@
...
@@ -54,34 +55,33 @@
#define S3C2410_NFCONF_TWRPH0(x) ((x)<<4)
#define S3C2410_NFCONF_TWRPH0(x) ((x)<<4)
#define S3C2410_NFCONF_TWRPH1(x) ((x)<<0)
#define S3C2410_NFCONF_TWRPH1(x) ((x)<<0)
static
void
s3c2410_hwcontrol
(
struct
mtd_info
*
mtd
,
int
cmd
)
#define S3C2410_ADDR_NALE 4
#define S3C2410_ADDR_NCLE 8
static
void
s3c2410_hwcontrol
(
struct
mtd_info
*
mtd
,
int
cmd
,
unsigned
int
ctrl
)
{
{
struct
nand_chip
*
chip
=
mtd
->
priv
;
struct
nand_chip
*
chip
=
mtd
->
priv
;
DEBUGN
(
"hwcontrol(): 0x%02x: "
,
cmd
);
DEBUGN
(
"hwcontrol(): 0x%02x 0x%02x
\n
"
,
cmd
,
ctrl
);
switch
(
cmd
)
{
if
(
ctrl
&
NAND_CTRL_CHANGE
)
{
case
NAND_CTL_SETNCE
:
ulong
IO_ADDR_W
=
NF_BASE
;
NFCONF
&=
~
S3C2410_NFCONF_nFCE
;
DEBUGN
(
"NFCONF=0x%08x
\n
"
,
NFCONF
);
if
(
!
(
ctrl
&
NAND_CLE
))
break
;
IO_ADDR_W
|=
S3C2410_ADDR_NCLE
;
case
NAND_CTL_CLRNCE
:
if
(
!
(
ctrl
&
NAND_ALE
))
NFCONF
|=
S3C2410_NFCONF_nFCE
;
IO_ADDR_W
|=
S3C2410_ADDR_NALE
;
DEBUGN
(
"NFCONF=0x%08x
\n
"
,
NFCONF
);
break
;
chip
->
IO_ADDR_W
=
(
void
*
)
IO_ADDR_W
;
case
NAND_CTL_SETALE
:
chip
->
IO_ADDR_W
=
NF_BASE
+
0x8
;
if
(
ctrl
&
NAND_NCE
)
DEBUGN
(
"SETALE
\n
"
);
NFCONF
&=
~
S3C2410_NFCONF_nFCE
;
break
;
else
case
NAND_CTL_SETCLE
:
NFCONF
|=
S3C2410_NFCONF_nFCE
;
chip
->
IO_ADDR_W
=
NF_BASE
+
0x4
;
DEBUGN
(
"SETCLE
\n
"
);
break
;
default:
chip
->
IO_ADDR_W
=
NF_BASE
+
0xc
;
break
;
}
}
return
;
if
(
cmd
!=
NAND_CMD_NONE
)
writeb
(
cmd
,
chip
->
IO_ADDR_W
);
}
}
static
int
s3c2410_dev_ready
(
struct
mtd_info
*
mtd
)
static
int
s3c2410_dev_ready
(
struct
mtd_info
*
mtd
)
...
@@ -93,7 +93,7 @@ static int s3c2410_dev_ready(struct mtd_info *mtd)
...
@@ -93,7 +93,7 @@ static int s3c2410_dev_ready(struct mtd_info *mtd)
#ifdef CONFIG_S3C2410_NAND_HWECC
#ifdef CONFIG_S3C2410_NAND_HWECC
void
s3c2410_nand_enable_hwecc
(
struct
mtd_info
*
mtd
,
int
mode
)
void
s3c2410_nand_enable_hwecc
(
struct
mtd_info
*
mtd
,
int
mode
)
{
{
DEBUGN
(
"s3c2410_nand_enable_hwecc(%p, %d)
\n
"
,
mtd
,
mode
);
DEBUGN
(
"s3c2410_nand_enable_hwecc(%p, %d)
\n
"
,
mtd
,
mode
);
NFCONF
|=
S3C2410_NFCONF_INITECC
;
NFCONF
|=
S3C2410_NFCONF_INITECC
;
}
}
...
@@ -143,23 +143,23 @@ int board_nand_init(struct nand_chip *nand)
...
@@ -143,23 +143,23 @@ int board_nand_init(struct nand_chip *nand)
NFCONF
=
cfg
;
NFCONF
=
cfg
;
/* initialize nand_chip data structure */
/* initialize nand_chip data structure */
nand
->
IO_ADDR_R
=
nand
->
IO_ADDR_W
=
0x4e00000c
;
nand
->
IO_ADDR_R
=
nand
->
IO_ADDR_W
=
(
void
*
)
0x4e00000c
;
/* read_buf and write_buf are default */
/* read_buf and write_buf are default */
/* read_byte and write_byte are default */
/* read_byte and write_byte are default */
/* hwcontrol always must be implemented */
/* hwcontrol always must be implemented */
nand
->
hwcon
tr
o
l
=
s3c2410_hwcontrol
;
nand
->
cmd_c
trl
=
s3c2410_hwcontrol
;
nand
->
dev_ready
=
s3c2410_dev_ready
;
nand
->
dev_ready
=
s3c2410_dev_ready
;
#ifdef CONFIG_S3C2410_NAND_HWECC
#ifdef CONFIG_S3C2410_NAND_HWECC
nand
->
e
nable_hwecc
=
s3c2410_nand_enable_hwecc
;
nand
->
e
cc
.
hwctl
=
s3c2410_nand_enable_hwecc
;
nand
->
calculate
_ecc
=
s3c2410_nand_calculate_ecc
;
nand
->
ecc
.
calculate
=
s3c2410_nand_calculate_ecc
;
nand
->
correct
_data
=
s3c2410_nand_correct_data
;
nand
->
ecc
.
correct
=
s3c2410_nand_correct_data
;
nand
->
eccmode
=
NAND_ECC_HW3_512
;
nand
->
ecc
.
mode
=
NAND_ECC_HW3_512
;
#else
#else
nand
->
eccmode
=
NAND_ECC_SOFT
;
nand
->
ecc
.
mode
=
NAND_ECC_SOFT
;
#endif
#endif
#ifdef CONFIG_S3C2410_NAND_BBT
#ifdef CONFIG_S3C2410_NAND_BBT
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment