Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci-2.6.23
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci-2.6.23
Commits
bdf0fabd
Commit
bdf0fabd
authored
May 26, 2008
by
邱宗炽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
large page nand flash support
parent
6a2fda26
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
5 deletions
+24
-5
arch/arm/mach-davinci/board-ntosd-644xA.c
arch/arm/mach-davinci/board-ntosd-644xA.c
+4
-4
drivers/mtd/nand/davinci_nand.c
drivers/mtd/nand/davinci_nand.c
+1
-1
drivers/mtd/nand/nand_base.c
drivers/mtd/nand/nand_base.c
+19
-0
No files found.
arch/arm/mach-davinci/board-ntosd-644xA.c
View file @
bdf0fabd
...
@@ -100,20 +100,20 @@ static struct platform_device ntosd_644xa_norflash_device = {
...
@@ -100,20 +100,20 @@ static struct platform_device ntosd_644xa_norflash_device = {
};
};
#if defined(CONFIG_MTD_NAND_DAVINCI) || defined(CONFIG_MTD_NAND_DAVINCI_MODULE)
#if defined(CONFIG_MTD_NAND_DAVINCI) || defined(CONFIG_MTD_NAND_DAVINCI_MODULE)
#define UBOOT_START 0x
18
000
#define UBOOT_START 0x
c0
000
struct
mtd_partition
ntosd_644xa_nandflash_partition
[]
=
{
struct
mtd_partition
ntosd_644xa_nandflash_partition
[]
=
{
/* uboot parameter */
/* uboot parameter */
{
{
.
name
=
"u-boot-parameter"
,
.
name
=
"u-boot-parameter"
,
.
offset
=
0
,
.
offset
=
0
,
.
size
=
1
*
SZ_1
6
K
,
.
size
=
1
*
SZ_1
28
K
,
.
mask_flags
=
0
,
.
mask_flags
=
0
,
},
},
/* ubl */
/* ubl */
{
{
.
name
=
"ubl"
,
.
name
=
"ubl"
,
.
offset
=
1
*
SZ_1
6
K
,
.
offset
=
1
*
SZ_1
28
K
,
.
size
=
5
*
SZ_1
6
K
,
.
size
=
5
*
SZ_1
28
K
,
.
mask_flags
=
0
,
.
mask_flags
=
0
,
},
},
/* 1 MB space from bootloader start for bootloader */
/* 1 MB space from bootloader start for bootloader */
...
...
drivers/mtd/nand/davinci_nand.c
View file @
bdf0fabd
...
@@ -55,7 +55,7 @@
...
@@ -55,7 +55,7 @@
#ifdef CONFIG_NAND_FLASH_HW_ECC
#ifdef CONFIG_NAND_FLASH_HW_ECC
#ifdef CONFIG_MACH_NTOSD_644XA
#ifdef CONFIG_MACH_NTOSD_644XA
#define DAVINCI_NAND_ECC_MODE NAND_ECC_HW
4_512
#define DAVINCI_NAND_ECC_MODE NAND_ECC_HW
16_2048
#else
#else
#define DAVINCI_NAND_ECC_MODE NAND_ECC_HW3_512
#define DAVINCI_NAND_ECC_MODE NAND_ECC_HW3_512
#endif
#endif
...
...
drivers/mtd/nand/nand_base.c
View file @
bdf0fabd
...
@@ -52,6 +52,11 @@
...
@@ -52,6 +52,11 @@
#include <linux/mtd/partitions.h>
#include <linux/mtd/partitions.h>
#endif
#endif
#ifdef CONFIG_MACH_NTOSD_644XA
#define DM6446_NAND_ECC_SIZE 512
#define DM6446_NAND_ECC_BYTES 4
#endif
/* Define default oob placement schemes for large and small page devices */
/* Define default oob placement schemes for large and small page devices */
static
struct
nand_ecclayout
nand_oob_8
=
{
static
struct
nand_ecclayout
nand_oob_8
=
{
.
eccbytes
=
3
,
.
eccbytes
=
3
,
...
@@ -808,9 +813,16 @@ static int nand_read_page_swecc(struct mtd_info *mtd, struct nand_chip *chip,
...
@@ -808,9 +813,16 @@ static int nand_read_page_swecc(struct mtd_info *mtd, struct nand_chip *chip,
static
int
nand_read_page_hwecc
(
struct
mtd_info
*
mtd
,
struct
nand_chip
*
chip
,
static
int
nand_read_page_hwecc
(
struct
mtd_info
*
mtd
,
struct
nand_chip
*
chip
,
uint8_t
*
buf
)
uint8_t
*
buf
)
{
{
#ifdef CONFIG_MACH_NTOSD_644XA
/* every 512 bytes generate 4 bytes ecc */
int
i
,
eccsize
=
DM6446_NAND_ECC_SIZE
;
int
eccbytes
=
DM6446_NAND_ECC_BYTES
;
int
eccsteps
=
chip
->
ecc
.
size
/
eccsize
;
#else
int
i
,
eccsize
=
chip
->
ecc
.
size
;
int
i
,
eccsize
=
chip
->
ecc
.
size
;
int
eccbytes
=
chip
->
ecc
.
bytes
;
int
eccbytes
=
chip
->
ecc
.
bytes
;
int
eccsteps
=
chip
->
ecc
.
steps
;
int
eccsteps
=
chip
->
ecc
.
steps
;
#endif
uint8_t
*
p
=
buf
;
uint8_t
*
p
=
buf
;
uint8_t
*
ecc_calc
=
chip
->
buffers
->
ecccalc
;
uint8_t
*
ecc_calc
=
chip
->
buffers
->
ecccalc
;
uint8_t
*
ecc_code
=
chip
->
buffers
->
ecccode
;
uint8_t
*
ecc_code
=
chip
->
buffers
->
ecccode
;
...
@@ -1441,9 +1453,16 @@ static void nand_write_page_swecc(struct mtd_info *mtd, struct nand_chip *chip,
...
@@ -1441,9 +1453,16 @@ static void nand_write_page_swecc(struct mtd_info *mtd, struct nand_chip *chip,
static
void
nand_write_page_hwecc
(
struct
mtd_info
*
mtd
,
struct
nand_chip
*
chip
,
static
void
nand_write_page_hwecc
(
struct
mtd_info
*
mtd
,
struct
nand_chip
*
chip
,
const
uint8_t
*
buf
)
const
uint8_t
*
buf
)
{
{
#ifdef CONFIG_MACH_NTOSD_644XA
/* every 512 bytes generate 4 bytes ecc */
int
i
,
eccsize
=
DM6446_NAND_ECC_SIZE
;
int
eccbytes
=
DM6446_NAND_ECC_BYTES
;
int
eccsteps
=
chip
->
ecc
.
size
/
eccsize
;
#else
int
i
,
eccsize
=
chip
->
ecc
.
size
;
int
i
,
eccsize
=
chip
->
ecc
.
size
;
int
eccbytes
=
chip
->
ecc
.
bytes
;
int
eccbytes
=
chip
->
ecc
.
bytes
;
int
eccsteps
=
chip
->
ecc
.
steps
;
int
eccsteps
=
chip
->
ecc
.
steps
;
#endif
uint8_t
*
ecc_calc
=
chip
->
buffers
->
ecccalc
;
uint8_t
*
ecc_calc
=
chip
->
buffers
->
ecccalc
;
const
uint8_t
*
p
=
buf
;
const
uint8_t
*
p
=
buf
;
uint32_t
*
eccpos
=
chip
->
ecc
.
layout
->
eccpos
;
uint32_t
*
eccpos
=
chip
->
ecc
.
layout
->
eccpos
;
...
...
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