mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
ipod5g/6g: support DEFAULT_VIRT_SECTOR_SIZE
This way if there's no valid partition/filesystem we still report the "correct" sector size out via USB. Update the ipod5g/6g bootloaders so they do the right thing too. Change-Id: I0d93ae7e6664f1591d8edf1c0252c586e329cd4b
This commit is contained in:
parent
1516c48a37
commit
c8e1da8e90
4 changed files with 35 additions and 16 deletions
|
@ -202,6 +202,13 @@ void fatal_error(void)
|
|||
#endif
|
||||
lcd_update();
|
||||
|
||||
#if defined(MAX_VIRT_SECTOR_SIZE) && defined(DEFAULT_VIRT_SECTOR_SIZE)
|
||||
#ifdef HAVE_MULTIDRIVE
|
||||
for (int i = 0 ; i < NUM_DRIVES ; i++)
|
||||
#endif
|
||||
disk_set_sector_multiplier(IF_MD(i,) DEFAULT_VIRT_SECTOR_SIZE);
|
||||
#endif
|
||||
|
||||
usb_init();
|
||||
while (1) {
|
||||
if (button_hold() != holdstatus) {
|
||||
|
|
|
@ -424,8 +424,15 @@ void main(void)
|
|||
|
||||
#ifdef HAVE_BOOTLOADER_USB_MODE
|
||||
/* Enter USB mode if SELECT+RIGHT are pressed */
|
||||
if (button_read_device() == (BUTTON_SELECT|BUTTON_RIGHT))
|
||||
if (button_read_device() == (BUTTON_SELECT|BUTTON_RIGHT)) {
|
||||
#if defined(MAX_VIRT_SECTOR_SIZE) && defined(DEFAULT_VIRT_SECTOR_SIZE)
|
||||
#ifdef HAVE_MULTIDRIVE
|
||||
for (int i = 0 ; i < NUM_DRIVES ; i++)
|
||||
#endif
|
||||
disk_set_sector_multiplier(IF_MD(i,) DEFAULT_VIRT_SECTOR_SIZE);
|
||||
#endif
|
||||
usb_mode();
|
||||
}
|
||||
#endif
|
||||
|
||||
rc = disk_mount_all();
|
||||
|
|
|
@ -194,6 +194,9 @@
|
|||
/* define this if the device has larger sectors when accessed via USB */
|
||||
#define MAX_VIRT_SECTOR_SIZE 4096
|
||||
|
||||
/* If we have no valid paritions, advertise this as our sector size */
|
||||
#define DEFAULT_VIRT_SECTOR_SIZE 4096
|
||||
|
||||
/* This is the minimum access size for the device, even if it's larger than the logical sector size */
|
||||
#define MAX_PHYS_SECTOR_SIZE 4096
|
||||
|
||||
|
|
|
@ -214,9 +214,11 @@
|
|||
#define HAVE_HARDWARE_CLICK
|
||||
|
||||
/* define this if the device has larger sectors when accessed via USB */
|
||||
/* (only relevant in disk.c, fat.c now always supports large virtual sectors) */
|
||||
#define MAX_VIRT_SECTOR_SIZE 2048
|
||||
|
||||
/* If we have no valid paritions, advertise this as our sector size */
|
||||
#define DEFAULT_VIRT_SECTOR_SIZE 2048
|
||||
|
||||
/* define this if the hard drive uses large physical sectors (ATA-7 feature) */
|
||||
/* and doesn't handle them in the drive firmware */
|
||||
#define MAX_PHYS_SECTOR_SIZE 1024
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue