mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
ipod6g: CE-ATA uses a 4K block size at minimum
Therefore, turn on MAX_VARIABLE_LOG_SECTOR so we can support 512B and 4K sector sizes. Additionally, correct the interpretation of identify info word 106 in CE-ATA mode. Change-Id: I24dc7dd4a8617fcb60ed87c0c1be98d00dbdfa30
This commit is contained in:
parent
4960a3b753
commit
9644bb5d9d
2 changed files with 11 additions and 1 deletions
|
@ -203,7 +203,7 @@
|
||||||
#define MAX_PHYS_SECTOR_SIZE 4096
|
#define MAX_PHYS_SECTOR_SIZE 4096
|
||||||
|
|
||||||
/* define this if we want to support 512n and 4Kn drives */
|
/* define this if we want to support 512n and 4Kn drives */
|
||||||
//#define MAX_VARIABLE_LOG_SECTOR 4096
|
#define MAX_VARIABLE_LOG_SECTOR 4096
|
||||||
|
|
||||||
#define HAVE_HARDWARE_CLICK
|
#define HAVE_HARDWARE_CLICK
|
||||||
|
|
||||||
|
|
|
@ -1170,9 +1170,19 @@ int ata_init(void)
|
||||||
/* Logical sector size */
|
/* Logical sector size */
|
||||||
if ((identify_info[106] & 0xd000) == 0x5000) /* B14, B12 */
|
if ((identify_info[106] & 0xd000) == 0x5000) /* B14, B12 */
|
||||||
log_sector_size = (identify_info[117] | (identify_info[118] << 16)) * 2;
|
log_sector_size = (identify_info[117] | (identify_info[118] << 16)) * 2;
|
||||||
|
else if (ceata)
|
||||||
|
log_sector_size = 1 << identify_info[106];
|
||||||
else
|
else
|
||||||
log_sector_size = 512;
|
log_sector_size = 512;
|
||||||
|
|
||||||
|
#ifndef MAX_VARIABLE_LOG_SECTOR
|
||||||
|
if (log_sector_size != SECTOR_SIZE)
|
||||||
|
panicf("Bad logical sector size (%ld)", log_sector_size);
|
||||||
|
#else
|
||||||
|
if (log_sector_size > MAX_VARIABLE_LOG_SECTOR)
|
||||||
|
panicf("Logical sector size too large (%ld)", log_sector_size);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef MAX_PHYS_SECTOR_SIZE
|
#ifdef MAX_PHYS_SECTOR_SIZE
|
||||||
rc = ata_get_phys_sector_mult();
|
rc = ata_get_phys_sector_mult();
|
||||||
if (IS_ERR(rc))
|
if (IS_ERR(rc))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue