mirror of
https://github.com/rvtr/twl_wrapsdk.git
synced 2025-10-31 06:11:10 -04:00
fix warnings
git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/twl_wrapsdk/trunk@233 4ee2a332-4b2b-5046-8439-1ba90f034370
This commit is contained in:
parent
0d3ae3a16d
commit
232d6ba1a2
@ -77,6 +77,7 @@ u32 NAND_FAT1_SECTORS;
|
|||||||
u32 NAND_FAT2_SECTORS;
|
u32 NAND_FAT2_SECTORS;
|
||||||
u32 NAND_FAT3_SECTORS;
|
u32 NAND_FAT3_SECTORS;
|
||||||
|
|
||||||
|
void nandSetFormatRequest( u16 partition_num, u32* partition_sectors);
|
||||||
void nandSetFormatRequest( u16 partition_num, u32* partition_sectors)
|
void nandSetFormatRequest( u16 partition_num, u32* partition_sectors)
|
||||||
{
|
{
|
||||||
NAND_RAW_SECTORS = partition_sectors[0];
|
NAND_RAW_SECTORS = partition_sectors[0];
|
||||||
@ -258,8 +259,8 @@ int nandRtfsCtrl( int driveno, int opcode, void* pargs)
|
|||||||
gc.fmt.oemname[1] = 'W';
|
gc.fmt.oemname[1] = 'W';
|
||||||
gc.fmt.oemname[2] = 'L';
|
gc.fmt.oemname[2] = 'L';
|
||||||
gc.fmt.oemname[3] = '\0';
|
gc.fmt.oemname[3] = '\0';
|
||||||
gc.fmt.secpalloc = NandFatSpec[pdr->partition_number].SC; /*sectors per cluster(FIX by capacity)*/
|
gc.fmt.secpalloc = (u8)(NandFatSpec[pdr->partition_number].SC); /*sectors per cluster(FIX by capacity)*/
|
||||||
gc.fmt.secreserved = NandFatSpec[pdr->partition_number].RSC;//sdmc_current_spec.RSC;/*reserved sectors(FIX 1 at FAT12,16)*/
|
gc.fmt.secreserved = (u16)(NandFatSpec[pdr->partition_number].RSC);//sdmc_current_spec.RSC;/*reserved sectors(FIX 1 at FAT12,16)*/
|
||||||
gc.fmt.numfats = 2;
|
gc.fmt.numfats = 2;
|
||||||
gc.fmt.secpfat = NandFatSpec[pdr->partition_number].SF;
|
gc.fmt.secpfat = NandFatSpec[pdr->partition_number].SF;
|
||||||
gc.fmt.numhide = NandFatSpec[pdr->partition_number].NOM; /**/
|
gc.fmt.numhide = NandFatSpec[pdr->partition_number].NOM; /**/
|
||||||
@ -267,8 +268,8 @@ int nandRtfsCtrl( int driveno, int opcode, void* pargs)
|
|||||||
gc.fmt.mediadesc = 0xF8;
|
gc.fmt.mediadesc = 0xF8;
|
||||||
gc.fmt.secptrk = NandFatSpec[pdr->partition_number].secptrack; //CHS Recommendation
|
gc.fmt.secptrk = NandFatSpec[pdr->partition_number].secptrack; //CHS Recommendation
|
||||||
gc.fmt.numhead = NandFatSpec[pdr->partition_number].heads;
|
gc.fmt.numhead = NandFatSpec[pdr->partition_number].heads;
|
||||||
gc.fmt.numcyl = gc.dev_geometry_cylinders;//NandFatSpec[pdr->partition_number].cylinders;
|
gc.fmt.numcyl = (u16)(gc.dev_geometry_cylinders);//NandFatSpec[pdr->partition_number].cylinders;
|
||||||
gc.fmt.physical_drive_no = driveno;
|
gc.fmt.physical_drive_no = (u8)driveno;
|
||||||
gc.fmt.binary_volume_label = BIN_VOL_LABEL;
|
gc.fmt.binary_volume_label = BIN_VOL_LABEL;
|
||||||
gc.fmt.text_volume_label[0] = '\0';
|
gc.fmt.text_volume_label[0] = '\0';
|
||||||
|
|
||||||
@ -382,8 +383,8 @@ BOOL nandRtfsAttach( int driveno, int partition_no)
|
|||||||
/*SD File System Specification(仕様書)に基づいた値を出す*/
|
/*SD File System Specification(仕様書)に基づいた値を出す*/
|
||||||
static BOOL sdi_get_CHS_params( void)
|
static BOOL sdi_get_CHS_params( void)
|
||||||
{
|
{
|
||||||
u16 i;
|
u32 i;
|
||||||
int mbytes;
|
u32 mbytes;
|
||||||
u32 cumulative_capacity; //累計
|
u32 cumulative_capacity; //累計
|
||||||
|
|
||||||
/**/
|
/**/
|
||||||
@ -478,23 +479,23 @@ static BOOL sdi_get_CHS_params( void)
|
|||||||
NandFatSpec[i].device_capacity = sdmc_current_spec.memory_capacity;
|
NandFatSpec[i].device_capacity = sdmc_current_spec.memory_capacity;
|
||||||
|
|
||||||
/*---------- デバイス全体 ----------*/
|
/*---------- デバイス全体 ----------*/
|
||||||
NandFatSpec[i].cylinders = /*シリンダ数を計算*/
|
NandFatSpec[i].cylinders = (u16) /*シリンダ数を計算*/
|
||||||
(NandFatSpec[i].device_capacity /
|
(NandFatSpec[i].device_capacity /
|
||||||
(NandFatSpec[i].heads * NandFatSpec[i].secptrack));
|
(NandFatSpec[i].heads * NandFatSpec[i].secptrack));
|
||||||
|
|
||||||
/*memory_capacityを再計算してadjusted_memory_capacityに格納*/
|
/*memory_capacityを再計算してadjusted_memory_capacityに格納*/
|
||||||
NandFatSpec[i].adjusted_device_capacity =
|
NandFatSpec[i].adjusted_device_capacity = (u32)
|
||||||
NandFatSpec[i].cylinders *
|
(NandFatSpec[i].cylinders *
|
||||||
(NandFatSpec[i].heads * NandFatSpec[i].secptrack);
|
(NandFatSpec[i].heads * NandFatSpec[i].secptrack));
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
|
|
||||||
/*---------- ボリューム ----------*/
|
/*---------- ボリューム ----------*/
|
||||||
NandFatSpec[i].volume_cylinders = /*シリンダ数を計算*/
|
NandFatSpec[i].volume_cylinders = (u16) /*シリンダ数を計算*/
|
||||||
(NandFatSpec[i].memory_capacity /
|
(NandFatSpec[i].memory_capacity /
|
||||||
(NandFatSpec[i].heads * NandFatSpec[i].secptrack));
|
(NandFatSpec[i].heads * NandFatSpec[i].secptrack));
|
||||||
|
|
||||||
/*memory_capacityを再計算してadjusted_memory_capacityに格納*/
|
/*memory_capacityを再計算してadjusted_memory_capacityに格納*/
|
||||||
NandFatSpec[i].adjusted_memory_capacity =
|
NandFatSpec[i].adjusted_memory_capacity = (u32)
|
||||||
(NandFatSpec[i].volume_cylinders *
|
(NandFatSpec[i].volume_cylinders *
|
||||||
(NandFatSpec[i].heads * NandFatSpec[i].secptrack));
|
(NandFatSpec[i].heads * NandFatSpec[i].secptrack));
|
||||||
/*--------------------------------*/
|
/*--------------------------------*/
|
||||||
@ -550,7 +551,7 @@ static BOOL sdi_get_nom( u32 MIN_NOM)
|
|||||||
|
|
||||||
SC = NandFatSpec[i].SC;
|
SC = NandFatSpec[i].SC;
|
||||||
|
|
||||||
NandFatSpec[i].SF = sdi_get_ceil( TS[i]/SC * NandFatSpec[i].FATBITS, SS*8);
|
NandFatSpec[i].SF = (u16)sdi_get_ceil( TS[i]/SC * NandFatSpec[i].FATBITS, SS*8);
|
||||||
|
|
||||||
/*-----------------------SDHCのとき----------------------------*/
|
/*-----------------------SDHCのとき----------------------------*/
|
||||||
if( sdmc_current_spec.csd_ver2_flag) {
|
if( sdmc_current_spec.csd_ver2_flag) {
|
||||||
@ -563,7 +564,7 @@ static BOOL sdi_get_nom( u32 MIN_NOM)
|
|||||||
sdmc_current_spec.NOM = sdmc_current_spec.BU;
|
sdmc_current_spec.NOM = sdmc_current_spec.BU;
|
||||||
}
|
}
|
||||||
do {
|
do {
|
||||||
n = sdi_get_ceil( 2*NandFatSpec[i].SF, NandFatSpec[i].BU);
|
n = sdi_get_ceil( (u32)(2*NandFatSpec[i].SF), (u32)(NandFatSpec[i].BU));
|
||||||
NandFatSpec[i].RSC = (NandFatSpec[i].BU * n) - ( 2 * NandFatSpec[i].SF);
|
NandFatSpec[i].RSC = (NandFatSpec[i].BU * n) - ( 2 * NandFatSpec[i].SF);
|
||||||
if( NandFatSpec[i].RSC < 9) {
|
if( NandFatSpec[i].RSC < 9) {
|
||||||
NandFatSpec[i].RSC += NandFatSpec[i].BU;
|
NandFatSpec[i].RSC += NandFatSpec[i].BU;
|
||||||
@ -612,7 +613,7 @@ static BOOL sdi_get_nom( u32 MIN_NOM)
|
|||||||
}
|
}
|
||||||
}while( 1);
|
}while( 1);
|
||||||
if( SFdash != NandFatSpec[i].SF) {
|
if( SFdash != NandFatSpec[i].SF) {
|
||||||
NandFatSpec[i].SF = SFdash;
|
NandFatSpec[i].SF = (u16)SFdash;
|
||||||
}else{
|
}else{
|
||||||
break; //complete
|
break; //complete
|
||||||
}
|
}
|
||||||
@ -766,18 +767,18 @@ static void sdi_build_partition_table( void)
|
|||||||
MI_CpuFill8( MbrSectDat, 0, 512);
|
MI_CpuFill8( MbrSectDat, 0, 512);
|
||||||
|
|
||||||
for( i=0; i<4; i++) {
|
for( i=0; i<4; i++) {
|
||||||
MbrSectDat[(446+(i*16))/2] = (starting_head[i]<<8);
|
MbrSectDat[(446+(i*16))/2] = (u16)(starting_head[i]<<8);
|
||||||
//上位8bit:starting_cylの下位8bit, 下位8bit:starting_cylの上位2bit + starting_sect 6bit.
|
//上位8bit:starting_cylの下位8bit, 下位8bit:starting_cylの上位2bit + starting_sect 6bit.
|
||||||
MbrSectDat[(448+(i*16))/2] = (starting_cyl[i]<<8) +
|
MbrSectDat[(448+(i*16))/2] = (u16)((starting_cyl[i]<<8) +
|
||||||
((starting_cyl[i]>>2) & 0xC0) + starting_sect[i];
|
((starting_cyl[i]>>2) & 0xC0) + starting_sect[i]);
|
||||||
MbrSectDat[(450+(i*16))/2] = (ending_head[i]<<8) + systemid[i];
|
MbrSectDat[(450+(i*16))/2] = (u16)((ending_head[i]<<8) + systemid[i]);
|
||||||
//上位8bit:ending_cylの下位8bit, 下位8bit:ending_cylの上位2bit + ending_sect 6bit.
|
//上位8bit:ending_cylの下位8bit, 下位8bit:ending_cylの上位2bit + ending_sect 6bit.
|
||||||
MbrSectDat[(452+(i*16))/2] = (ending_cyl[i]<<8) +
|
MbrSectDat[(452+(i*16))/2] = (u16)((ending_cyl[i]<<8) +
|
||||||
((ending_cyl[i]>>2) & 0xC0) + ending_sect[i];
|
((ending_cyl[i]>>2) & 0xC0) + ending_sect[i]);
|
||||||
MbrSectDat[(454+(i*16))/2] = NandFatSpec[i].NOM;
|
MbrSectDat[(454+(i*16))/2] = (u16)(NandFatSpec[i].NOM);
|
||||||
MbrSectDat[(456+(i*16))/2] = (NandFatSpec[i].NOM>>16);
|
MbrSectDat[(456+(i*16))/2] = (u16)(NandFatSpec[i].NOM>>16);
|
||||||
MbrSectDat[(458+(i*16))/2] = total_sect[i];
|
MbrSectDat[(458+(i*16))/2] = (u16)(total_sect[i]);
|
||||||
MbrSectDat[(460+(i*16))/2] = (total_sect[i]>>16);
|
MbrSectDat[(460+(i*16))/2] = (u16)(total_sect[i]>>16);
|
||||||
}
|
}
|
||||||
MbrSectDat[510/2] = 0xAA55;
|
MbrSectDat[510/2] = 0xAA55;
|
||||||
/*セクタ0に書き込み*/
|
/*セクタ0に書き込み*/
|
||||||
|
|||||||
@ -456,12 +456,12 @@ static void sdi_get_CHS_params( void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*シリンダ数を計算*/
|
/*シリンダ数を計算*/
|
||||||
sdmc_current_spec.cylinders = (sdmc_current_spec.memory_capacity /
|
sdmc_current_spec.cylinders = (u16)(sdmc_current_spec.memory_capacity /
|
||||||
(sdmc_current_spec.heads * sdmc_current_spec.secptrack));
|
(sdmc_current_spec.heads * sdmc_current_spec.secptrack));
|
||||||
|
|
||||||
/*memory_capacityを再計算してadjusted_memory_capacityに格納*/
|
/*memory_capacityを再計算してadjusted_memory_capacityに格納*/
|
||||||
sdmc_current_spec.adjusted_memory_capacity = sdmc_current_spec.cylinders *
|
sdmc_current_spec.adjusted_memory_capacity = (u32)(sdmc_current_spec.cylinders *
|
||||||
(sdmc_current_spec.heads * sdmc_current_spec.secptrack);
|
(sdmc_current_spec.heads * sdmc_current_spec.secptrack));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -484,13 +484,13 @@ static void sdi_get_nom( void)
|
|||||||
TS = sdmc_current_spec.adjusted_memory_capacity;
|
TS = sdmc_current_spec.adjusted_memory_capacity;
|
||||||
SC = sdmc_current_spec.SC;
|
SC = sdmc_current_spec.SC;
|
||||||
|
|
||||||
sdmc_current_spec.SF = sdi_get_ceil( TS/SC * sdmc_current_spec.FATBITS, SS*8);
|
sdmc_current_spec.SF = (u16)sdi_get_ceil( TS/SC * sdmc_current_spec.FATBITS, SS*8);
|
||||||
|
|
||||||
/*-----------------------SDHCのとき----------------------------*/
|
/*-----------------------SDHCのとき----------------------------*/
|
||||||
if( sdmc_current_spec.csd_ver2_flag) {
|
if( sdmc_current_spec.csd_ver2_flag) {
|
||||||
sdmc_current_spec.NOM = sdmc_current_spec.BU;
|
sdmc_current_spec.NOM = sdmc_current_spec.BU;
|
||||||
do {
|
do {
|
||||||
n = sdi_get_ceil( 2*sdmc_current_spec.SF, sdmc_current_spec.BU);
|
n = sdi_get_ceil( (u32)(2*sdmc_current_spec.SF), (u32)(sdmc_current_spec.BU));
|
||||||
sdmc_current_spec.RSC = (sdmc_current_spec.BU * n) - ( 2 * sdmc_current_spec.SF);
|
sdmc_current_spec.RSC = (sdmc_current_spec.BU * n) - ( 2 * sdmc_current_spec.SF);
|
||||||
if( sdmc_current_spec.RSC < 9) {
|
if( sdmc_current_spec.RSC < 9) {
|
||||||
sdmc_current_spec.RSC += sdmc_current_spec.BU;
|
sdmc_current_spec.RSC += sdmc_current_spec.BU;
|
||||||
@ -530,7 +530,7 @@ static void sdi_get_nom( void)
|
|||||||
}
|
}
|
||||||
}while( 1);
|
}while( 1);
|
||||||
if( SFdash != sdmc_current_spec.SF) {
|
if( SFdash != sdmc_current_spec.SF) {
|
||||||
sdmc_current_spec.SF = SFdash;
|
sdmc_current_spec.SF = (u16)SFdash;
|
||||||
}else{
|
}else{
|
||||||
break; //complete
|
break; //complete
|
||||||
}
|
}
|
||||||
@ -543,7 +543,7 @@ static void sdi_get_nom( void)
|
|||||||
/*FATのビット数を返す*/
|
/*FATのビット数を返す*/
|
||||||
static void sdi_get_fatparams( void)
|
static void sdi_get_fatparams( void)
|
||||||
{
|
{
|
||||||
int mbytes;
|
u32 mbytes;
|
||||||
|
|
||||||
// mbytes = (sdmc_current_spec.card_capacity / (1024 * 1024)) * 512;
|
// mbytes = (sdmc_current_spec.card_capacity / (1024 * 1024)) * 512;
|
||||||
mbytes = (sdmc_current_spec.card_capacity >> 11);
|
mbytes = (sdmc_current_spec.card_capacity >> 11);
|
||||||
@ -658,16 +658,16 @@ static void sdi_build_partition_table( void)
|
|||||||
#else
|
#else
|
||||||
MI_CpuFill8( MbrSectDat, 0, 512);
|
MI_CpuFill8( MbrSectDat, 0, 512);
|
||||||
#endif
|
#endif
|
||||||
MbrSectDat[446/2] = (starting_head<<8);
|
MbrSectDat[446/2] = (u16)(starting_head<<8);
|
||||||
//上位8bit:starting_cylの下位8bit, 下位8bit:starting_cylの上位2bit + starting_sect 6bit.
|
//上位8bit:starting_cylの下位8bit, 下位8bit:starting_cylの上位2bit + starting_sect 6bit.
|
||||||
MbrSectDat[448/2] = (starting_cyl<<8) + ((starting_cyl>>2) & 0xC0) + starting_sect;
|
MbrSectDat[448/2] = (u16)((starting_cyl<<8) + ((starting_cyl>>2) & 0xC0) + starting_sect);
|
||||||
MbrSectDat[450/2] = (ending_head<<8) + systemid;
|
MbrSectDat[450/2] = (u16)((ending_head<<8) + systemid);
|
||||||
//上位8bit:ending_cylの下位8bit, 下位8bit:ending_cylの上位2bit + ending_sect 6bit.
|
//上位8bit:ending_cylの下位8bit, 下位8bit:ending_cylの上位2bit + ending_sect 6bit.
|
||||||
MbrSectDat[452/2] = (ending_cyl<<8) + ((ending_cyl>>2) & 0xC0) + ending_sect;
|
MbrSectDat[452/2] = (u16)((ending_cyl<<8) + ((ending_cyl>>2) & 0xC0) + ending_sect);
|
||||||
MbrSectDat[454/2] = sdmc_current_spec.NOM;
|
MbrSectDat[454/2] = (u16)(sdmc_current_spec.NOM);
|
||||||
MbrSectDat[456/2] = (sdmc_current_spec.NOM>>16);
|
MbrSectDat[456/2] = (u16)(sdmc_current_spec.NOM>>16);
|
||||||
MbrSectDat[458/2] = total_sect;
|
MbrSectDat[458/2] = (u16)total_sect;
|
||||||
MbrSectDat[460/2] = (total_sect>>16);
|
MbrSectDat[460/2] = (u16)(total_sect>>16);
|
||||||
MbrSectDat[510/2] = 0xAA55;
|
MbrSectDat[510/2] = 0xAA55;
|
||||||
/*セクタ0に書き込み*/
|
/*セクタ0に書き込み*/
|
||||||
sdmcWriteFifo( MbrSectDat, 1, 0, NULL, &SdResult);
|
sdmcWriteFifo( MbrSectDat, 1, 0, NULL, &SdResult);
|
||||||
|
|||||||
@ -782,7 +782,7 @@ u16 SD_SelectBitWidth(s16 b4bit)
|
|||||||
Returns: 0 : success
|
Returns: 0 : success
|
||||||
> 0 : error
|
> 0 : error
|
||||||
*---------------------------------------------------------------------------*/
|
*---------------------------------------------------------------------------*/
|
||||||
u16 MMCP_WriteBusWidth(s16 b4bit)
|
u16 MMCP_WriteBusWidth( BOOL b4bit)
|
||||||
{
|
{
|
||||||
if( !SDCARD_MMCFlag) {
|
if( !SDCARD_MMCFlag) {
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
@ -321,7 +321,7 @@ void SD_DisableClock( void); /* SD
|
|||||||
|
|
||||||
u16 SD_SelectBitWidth(s16 b4bit); /* ビット幅の選択 */
|
u16 SD_SelectBitWidth(s16 b4bit); /* ビット幅の選択 */
|
||||||
|
|
||||||
u16 MMCP_WriteBusWidth(s16 b4bit);
|
u16 MMCP_WriteBusWidth( BOOL b4bit);
|
||||||
u16 MMCP_BusTest( BOOL readflag);
|
u16 MMCP_BusTest( BOOL readflag);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user