summaryrefslogtreecommitdiff
path: root/firmware/target/arm/imx233
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/imx233')
-rw-r--r--firmware/target/arm/imx233/nand-imx233.c4
-rw-r--r--firmware/target/arm/imx233/partitions-imx233.c2
-rw-r--r--firmware/target/arm/imx233/partitions-imx233.h6
-rw-r--r--firmware/target/arm/imx233/sdmmc-imx233.c16
4 files changed, 14 insertions, 14 deletions
diff --git a/firmware/target/arm/imx233/nand-imx233.c b/firmware/target/arm/imx233/nand-imx233.c
index a7afba7d43..22da408e05 100644
--- a/firmware/target/arm/imx233/nand-imx233.c
+++ b/firmware/target/arm/imx233/nand-imx233.c
@@ -36,13 +36,13 @@ int nand_init(void)
36{ 36{
37 return -1; 37 return -1;
38} 38}
39int nand_read_sectors(IF_MD(int drive,) unsigned long start, int count, 39int nand_read_sectors(IF_MD(int drive,) sector_t start, int count,
40 void* buf) 40 void* buf)
41{ 41{
42 return -1; 42 return -1;
43} 43}
44 44
45int nand_write_sectors(IF_MD(int drive,) unsigned long start, int count, 45int nand_write_sectors(IF_MD(int drive,) sector_t start, int count,
46 const void* buf) 46 const void* buf)
47{ 47{
48 return -1; 48 return -1;
diff --git a/firmware/target/arm/imx233/partitions-imx233.c b/firmware/target/arm/imx233/partitions-imx233.c
index 83a0bf8b42..965f98dca5 100644
--- a/firmware/target/arm/imx233/partitions-imx233.c
+++ b/firmware/target/arm/imx233/partitions-imx233.c
@@ -71,7 +71,7 @@ static const char *creative_part_name(enum imx233_part_t part)
71} 71}
72 72
73static int compute_window_creative(intptr_t user, part_read_fn_t read_fn, 73static int compute_window_creative(intptr_t user, part_read_fn_t read_fn,
74 enum imx233_part_t part, unsigned *start, unsigned *end) 74 enum imx233_part_t part, sector_t *start, unsigned *end)
75{ 75{
76 uint8_t mblk[512]; 76 uint8_t mblk[512];
77 int ret = read_fn(user, MBLK_ADDR / 512, 1, mblk); 77 int ret = read_fn(user, MBLK_ADDR / 512, 1, mblk);
diff --git a/firmware/target/arm/imx233/partitions-imx233.h b/firmware/target/arm/imx233/partitions-imx233.h
index e5378dadbb..4c8f703c2d 100644
--- a/firmware/target/arm/imx233/partitions-imx233.h
+++ b/firmware/target/arm/imx233/partitions-imx233.h
@@ -45,7 +45,7 @@ enum imx233_part_t
45/** The computation function can be called very early in the boot, at which point 45/** The computation function can be called very early in the boot, at which point
46 * usual storage read/write function may not be available. To workaround this 46 * usual storage read/write function may not be available. To workaround this
47 * issue, one must provide a read function. */ 47 * issue, one must provide a read function. */
48typedef int (*part_read_fn_t)(intptr_t user, unsigned long start, int count, void* buf); 48typedef int (*part_read_fn_t)(intptr_t user, sector_t start, int count, void* buf);
49/* Enable/Disable window computations for internal storage following the 49/* Enable/Disable window computations for internal storage following the
50 * Freescale/Creative convention */ 50 * Freescale/Creative convention */
51void imx233_partitions_enable_window(bool enable); 51void imx233_partitions_enable_window(bool enable);
@@ -55,6 +55,6 @@ bool imx233_partitions_is_window_enabled(void);
55 * for a whole disk, *end should be the size of the disk when the function is 55 * for a whole disk, *end should be the size of the disk when the function is
56 * called */ 56 * called */
57int imx233_partitions_compute_window(intptr_t user, part_read_fn_t read_fn, 57int imx233_partitions_compute_window(intptr_t user, part_read_fn_t read_fn,
58 enum imx233_part_t part, unsigned *start, unsigned *end); 58 enum imx233_part_t part, sector_t *start, unsigned *end);
59 59
60#endif /* __PARTITIONS_IMX233__ */ \ No newline at end of file 60#endif /* __PARTITIONS_IMX233__ */
diff --git a/firmware/target/arm/imx233/sdmmc-imx233.c b/firmware/target/arm/imx233/sdmmc-imx233.c
index af090e8a07..5577c6002d 100644
--- a/firmware/target/arm/imx233/sdmmc-imx233.c
+++ b/firmware/target/arm/imx233/sdmmc-imx233.c
@@ -648,7 +648,7 @@ int mmc_event(long id, intptr_t data)
648#endif /* CONFIG_STORAGE & STORAGE_MMC */ 648#endif /* CONFIG_STORAGE & STORAGE_MMC */
649 649
650/* low-level function, don't call directly! */ 650/* low-level function, don't call directly! */
651static int __xfer_sectors(int drive, unsigned long start, int count, void *buf, bool read) 651static int __xfer_sectors(int drive, sector_t start, int count, void *buf, bool read)
652{ 652{
653 uint32_t resp; 653 uint32_t resp;
654 int ret = 0; 654 int ret = 0;
@@ -660,7 +660,7 @@ static int __xfer_sectors(int drive, unsigned long start, int count, void *buf,
660 need_stop = false; 660 need_stop = false;
661 /* Set bank_start to the correct unit (blocks or bytes). 661 /* Set bank_start to the correct unit (blocks or bytes).
662 * MMC drives use block addressing, SD cards bytes or blocks */ 662 * MMC drives use block addressing, SD cards bytes or blocks */
663 int bank_start = start; 663 sector_t bank_start = start;
664 if(SDMMC_MODE(drive) == SD_MODE && !(SDMMC_INFO(drive).ocr & (1<<30))) /* not SDHC */ 664 if(SDMMC_MODE(drive) == SD_MODE && !(SDMMC_INFO(drive).ocr & (1<<30))) /* not SDHC */
665 bank_start *= SD_BLOCK_SIZE; 665 bank_start *= SD_BLOCK_SIZE;
666 /* issue read/write 666 /* issue read/write
@@ -686,7 +686,7 @@ static int __xfer_sectors(int drive, unsigned long start, int count, void *buf,
686 return ret; 686 return ret;
687} 687}
688 688
689static int transfer_sectors(int drive, unsigned long start, int count, void *buf, bool read) 689static int transfer_sectors(int drive, sector_t start, int count, void *buf, bool read)
690{ 690{
691 int ret = 0; 691 int ret = 0;
692 /* the function doesn't work when count is 0 */ 692 /* the function doesn't work when count is 0 */
@@ -806,7 +806,7 @@ static int transfer_sectors(int drive, unsigned long start, int count, void *buf
806} 806}
807 807
808/* user specifies the sdmmc drive */ 808/* user specifies the sdmmc drive */
809static int part_read_fn(intptr_t user, unsigned long start, int count, void* buf) 809static int part_read_fn(intptr_t user, sector_t start, int count, void* buf)
810{ 810{
811 return transfer_sectors(user, start, count, buf, true); 811 return transfer_sectors(user, start, count, buf, true);
812} 812}
@@ -917,7 +917,7 @@ void sd_enable(bool on)
917 (void) on; 917 (void) on;
918} 918}
919 919
920int sd_read_sectors(IF_MD(int sd_drive,) unsigned long start, int count, void *buf) 920int sd_read_sectors(IF_MD(int sd_drive,) sector_t start, int count, void *buf)
921{ 921{
922#ifndef HAVE_MULTIDRIVE 922#ifndef HAVE_MULTIDRIVE
923 int sd_drive = 0; 923 int sd_drive = 0;
@@ -925,7 +925,7 @@ int sd_read_sectors(IF_MD(int sd_drive,) unsigned long start, int count, void *b
925 return transfer_sectors(sd_map[sd_drive], start, count, buf, true); 925 return transfer_sectors(sd_map[sd_drive], start, count, buf, true);
926} 926}
927 927
928int sd_write_sectors(IF_MD(int sd_drive,) unsigned long start, int count, const void* buf) 928int sd_write_sectors(IF_MD(int sd_drive,) sector_t start, int count, const void* buf)
929{ 929{
930#ifndef HAVE_MULTIDRIVE 930#ifndef HAVE_MULTIDRIVE
931 int sd_drive = 0; 931 int sd_drive = 0;
@@ -1039,7 +1039,7 @@ int mmc_spinup_time(void)
1039 return 0; 1039 return 0;
1040} 1040}
1041 1041
1042int mmc_read_sectors(IF_MD(int mmc_drive,) unsigned long start, int count, void *buf) 1042int mmc_read_sectors(IF_MD(int mmc_drive,) sector_t start, int count, void *buf)
1043{ 1043{
1044#ifndef HAVE_MULTIDRIVE 1044#ifndef HAVE_MULTIDRIVE
1045 int mmc_drive = 0; 1045 int mmc_drive = 0;
@@ -1047,7 +1047,7 @@ int mmc_read_sectors(IF_MD(int mmc_drive,) unsigned long start, int count, void
1047 return transfer_sectors(mmc_map[mmc_drive], start, count, buf, true); 1047 return transfer_sectors(mmc_map[mmc_drive], start, count, buf, true);
1048} 1048}
1049 1049
1050int mmc_write_sectors(IF_MD(int mmc_drive,) unsigned long start, int count, const void* buf) 1050int mmc_write_sectors(IF_MD(int mmc_drive,) sector_t start, int count, const void* buf)
1051{ 1051{
1052#ifndef HAVE_MULTIDRIVE 1052#ifndef HAVE_MULTIDRIVE
1053 int mmc_drive = 0; 1053 int mmc_drive = 0;