summaryrefslogtreecommitdiff
path: root/firmware/target/mips/ingenic_jz47xx/ata-nand-jz4760.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/mips/ingenic_jz47xx/ata-nand-jz4760.c')
-rw-r--r--firmware/target/mips/ingenic_jz47xx/ata-nand-jz4760.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/firmware/target/mips/ingenic_jz47xx/ata-nand-jz4760.c b/firmware/target/mips/ingenic_jz47xx/ata-nand-jz4760.c
index 914cd6d9d3..ff9b7e419e 100644
--- a/firmware/target/mips/ingenic_jz47xx/ata-nand-jz4760.c
+++ b/firmware/target/mips/ingenic_jz47xx/ata-nand-jz4760.c
@@ -110,7 +110,7 @@ struct nand_param {
110 110
111static struct nand_info* chip_info = NULL; 111static struct nand_info* chip_info = NULL;
112static struct nand_info* bank; 112static struct nand_info* bank;
113static unsigned long nand_size; 113static sector_t nand_size;
114static struct nand_param internal_param; 114static struct nand_param internal_param;
115static struct mutex nand_mtx; 115static struct mutex nand_mtx;
116#ifdef USE_DMA 116#ifdef USE_DMA
@@ -281,7 +281,7 @@ static void jz_rs_correct(unsigned char *dat, int idx, int mask)
281/* 281/*
282 * Read oob 282 * Read oob
283 */ 283 */
284static int jz_nand_read_oob(unsigned long page_addr, unsigned char *buf, int size) 284static int jz_nand_read_oob(sector_t page_addr, unsigned char *buf, int size)
285{ 285{
286 struct nand_param *nandp = &internal_param; 286 struct nand_param *nandp = &internal_param;
287 int page_size, row_cycle, bus_width; 287 int page_size, row_cycle, bus_width;
@@ -337,7 +337,7 @@ static int jz_nand_read_oob(unsigned long page_addr, unsigned char *buf, int siz
337 * page - page number within a block: 0, 1, 2, ... 337 * page - page number within a block: 0, 1, 2, ...
338 * dst - pointer to target buffer 338 * dst - pointer to target buffer
339 */ 339 */
340static int jz_nand_read_page(unsigned long page_addr, unsigned char *dst) 340static int jz_nand_read_page(sector_t page_addr, unsigned char *dst)
341{ 341{
342 struct nand_param *nandp = &internal_param; 342 struct nand_param *nandp = &internal_param;
343 int page_size, oob_size; 343 int page_size, oob_size;
@@ -532,7 +532,7 @@ int nand_init(void)
532 return res; 532 return res;
533} 533}
534 534
535static inline int read_sector(unsigned long start, unsigned int count, 535static inline int read_sector(sector_t start, unsigned int count,
536 void* buf, unsigned int chip_size) 536 void* buf, unsigned int chip_size)
537{ 537{
538 register int ret; 538 register int ret;
@@ -548,7 +548,7 @@ static inline int read_sector(unsigned long start, unsigned int count,
548 return ret; 548 return ret;
549} 549}
550 550
551static inline int write_sector(unsigned long start, unsigned int count, 551static inline int write_sector(sector_t start, unsigned int count,
552 const void* buf, unsigned int chip_size) 552 const void* buf, unsigned int chip_size)
553{ 553{
554 int ret = 0; 554 int ret = 0;
@@ -563,14 +563,14 @@ static inline int write_sector(unsigned long start, unsigned int count,
563 return ret; 563 return ret;
564} 564}
565 565
566int nand_read_sectors(IF_MD(int drive,) unsigned long start, int count, void* buf) 566int nand_read_sectors(IF_MD(int drive,) sector_t start, int count, void* buf)
567{ 567{
568#ifdef HAVE_MULTIDRIVE 568#ifdef HAVE_MULTIDRIVE
569 (void)drive; 569 (void)drive;
570#endif 570#endif
571 int ret = 0; 571 int ret = 0;
572 unsigned int _count, chip_size = chip_info->page_size; 572 unsigned int _count, chip_size = chip_info->page_size;
573 unsigned long _start; 573 sector_t _start;
574 574
575 logf("start"); 575 logf("start");
576 mutex_lock(&nand_mtx); 576 mutex_lock(&nand_mtx);
@@ -590,14 +590,14 @@ int nand_read_sectors(IF_MD(int drive,) unsigned long start, int count, void* bu
590 return ret; 590 return ret;
591} 591}
592 592
593int nand_write_sectors(IF_MD(int drive,) unsigned long start, int count, const void* buf) 593int nand_write_sectors(IF_MD(int drive,) sector_t start, int count, const void* buf)
594{ 594{
595#ifdef HAVE_MULTIDRIVE 595#ifdef HAVE_MULTIDRIVE
596 (void)drive; 596 (void)drive;
597#endif 597#endif
598 int ret = 0; 598 int ret = 0;
599 unsigned int _count, chip_size = chip_info->page_size; 599 unsigned int _count, chip_size = chip_info->page_size;
600 unsigned long _start; 600 sector_t _start;
601 601
602 logf("start"); 602 logf("start");
603 mutex_lock(&nand_mtx); 603 mutex_lock(&nand_mtx);