diff --git a/apps/main.c b/apps/main.c index 7a29e90ab0..b189ea2261 100644 --- a/apps/main.c +++ b/apps/main.c @@ -647,6 +647,15 @@ static void init(void) #endif lcd_puts(0, line++, rbversion); +#ifdef STORAGE_GET_INFO + struct storage_info sinfo; + storage_get_info(0, &sinfo); +#ifdef MAX_PHYS_SECTOR_SIZE + lcd_putsf(0, line++, "id: '%s' s:%u*%u", sinfo.product, sinfo.sector_size, sinfo.phys_sector_mult); +#else + lcd_putsf(0, line++, "id: '%s' s:%u", sinfo.product, sinfo.sector_size); +#endif +#endif struct partinfo pinfo; for (int i = 0 ; i < NUM_VOLUMES ; i++) { disk_partinfo(i, &pinfo); diff --git a/bootloader/ipod-s5l87xx.c b/bootloader/ipod-s5l87xx.c index fd7ac67296..08baf0dd3a 100644 --- a/bootloader/ipod-s5l87xx.c +++ b/bootloader/ipod-s5l87xx.c @@ -643,10 +643,10 @@ static void dump_bootflash(void) lcd_clear_display(); lcd_set_foreground(LCD_WHITE); line = 0; - + uint8_t page[FLASH_PAGE_SIZE]; printf("Total pages: %d", FLASH_PAGES); - + bootflash_init(SPI_PORT); for (int i = 0; i < FLASH_PAGES; i++) { @@ -720,12 +720,12 @@ static void devel_menu(void) lcd_set_foreground(LCD_RBYELLOW); line = 0; printf("Development menu"); - + for (size_t i = 0; i < items_count; i++) { lcd_set_foreground(i == selected_item ? LCD_GREEN : LCD_WHITE); printf(items[i]); } - + while (button_status() != BUTTON_NONE); bool done = false; @@ -911,6 +911,15 @@ void main(void) rc = disk_mount_all(); if (rc <= 0) { +#ifdef STORAGE_GET_INFO + struct storage_info sinfo; + storage_get_info(0, &sinfo); +#ifdef MAX_PHYS_SECTOR_SIZE + printf("id: '%s' s:%u*%u", sinfo.product, sinfo.sector_size, sinfo.phys_sector_mult); +#else + printf("id: '%s' s:%u", sinfo.product, sinfo.sector_size); +#endif +#endif struct partinfo pinfo; printf("No partition found"); for (int i = 0 ; i < NUM_VOLUMES ; i++) { diff --git a/bootloader/ipod.c b/bootloader/ipod.c index 229b9b4979..0f70d2b7ef 100644 --- a/bootloader/ipod.c +++ b/bootloader/ipod.c @@ -34,6 +34,7 @@ #include "ata.h" #include "file_internal.h" #include "disk.h" +#include "storage.h" #include "font.h" #include "adc.h" #include "backlight.h" @@ -364,6 +365,15 @@ void* main(void) rc = disk_mount_all(); if (rc<=0) { +#ifdef STORAGE_GET_INFO + struct storage_info sinfo; + storage_get_info(0, &sinfo); +#ifdef MAX_PHYS_SECTOR_SIZE + printf("id: '%s' s:%u*%u", sinfo.product, sinfo.sector_size, sinfo.phys_sector_mult); +#else + printf("id: '%s' s:%u", sinfo.product, sinfo.sector_size); +#endif +#endif for (int i = 0 ; i < NUM_VOLUMES ; i++) { disk_partinfo(i, &pinfo); if (pinfo.type) diff --git a/firmware/drivers/ata-common.c b/firmware/drivers/ata-common.c index 0f8672caf1..76f64898c3 100644 --- a/firmware/drivers/ata-common.c +++ b/firmware/drivers/ata-common.c @@ -30,6 +30,10 @@ static bool canflush = true; static int spinup_time = 0; static struct mutex ata_mutex SHAREDBSS_ATTR; +#ifdef MAX_PHYS_SECTOR_SIZE +static uint16_t phys_sector_mult = 1; +#endif + int ata_spinup_time(void) { return spinup_time; @@ -49,6 +53,9 @@ void ata_get_info(IF_MD(int drive,)struct storage_info *info) info->sector_size = log_sector_size; info->num_sectors = total_sectors; +#ifdef MAX_PHYS_SECTOR_SIZE + info->phys_sector_mult = phys_sector_mult; +#endif src = (unsigned short*)&identify_info[27]; dest = (unsigned short*)vendor; @@ -70,7 +77,6 @@ void ata_get_info(IF_MD(int drive,)struct storage_info *info) } #endif - #ifdef MAX_PHYS_SECTOR_SIZE #ifdef MAX_VARIABLE_LOG_SECTOR @@ -90,7 +96,6 @@ struct sector_cache_entry { }; /* buffer for reading and writing large physical sectors */ static struct sector_cache_entry sector_cache STORAGE_ALIGN_ATTR; -static uint16_t phys_sector_mult = 1; static int ata_transfer_sectors(uint64_t start, int incount, diff --git a/firmware/export/storage.h b/firmware/export/storage.h index f97cbf34d5..86dfde5002 100644 --- a/firmware/export/storage.h +++ b/firmware/export/storage.h @@ -108,6 +108,9 @@ struct storage_info { unsigned int sector_size; sector_t num_sectors; +#ifdef MAX_PHYS_SECTOR_SIZE + uint16_t phys_sector_mult; +#endif char *vendor; char *product; char *revision;