A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd

storage: report physical sector multiplier via storage_get_info()

Show this in in the info dump when we can't find a filesystem to mount
in main() plus in the ipod bootloaders

Change-Id: I3b437ae0032b17f29c0dd94043743f14d2b2f3ad

+42 -6
+9
apps/main.c
··· 647 647 #endif 648 648 lcd_puts(0, line++, rbversion); 649 649 650 + #ifdef STORAGE_GET_INFO 651 + struct storage_info sinfo; 652 + storage_get_info(0, &sinfo); 653 + #ifdef MAX_PHYS_SECTOR_SIZE 654 + lcd_putsf(0, line++, "id: '%s' s:%u*%u", sinfo.product, sinfo.sector_size, sinfo.phys_sector_mult); 655 + #else 656 + lcd_putsf(0, line++, "id: '%s' s:%u", sinfo.product, sinfo.sector_size); 657 + #endif 658 + #endif 650 659 struct partinfo pinfo; 651 660 for (int i = 0 ; i < NUM_VOLUMES ; i++) { 652 661 disk_partinfo(i, &pinfo);
+13 -4
bootloader/ipod-s5l87xx.c
··· 643 643 lcd_clear_display(); 644 644 lcd_set_foreground(LCD_WHITE); 645 645 line = 0; 646 - 646 + 647 647 uint8_t page[FLASH_PAGE_SIZE]; 648 648 printf("Total pages: %d", FLASH_PAGES); 649 - 649 + 650 650 bootflash_init(SPI_PORT); 651 651 652 652 for (int i = 0; i < FLASH_PAGES; i++) { ··· 720 720 lcd_set_foreground(LCD_RBYELLOW); 721 721 line = 0; 722 722 printf("Development menu"); 723 - 723 + 724 724 for (size_t i = 0; i < items_count; i++) { 725 725 lcd_set_foreground(i == selected_item ? LCD_GREEN : LCD_WHITE); 726 726 printf(items[i]); 727 727 } 728 - 728 + 729 729 while (button_status() != BUTTON_NONE); 730 730 731 731 bool done = false; ··· 911 911 912 912 rc = disk_mount_all(); 913 913 if (rc <= 0) { 914 + #ifdef STORAGE_GET_INFO 915 + struct storage_info sinfo; 916 + storage_get_info(0, &sinfo); 917 + #ifdef MAX_PHYS_SECTOR_SIZE 918 + printf("id: '%s' s:%u*%u", sinfo.product, sinfo.sector_size, sinfo.phys_sector_mult); 919 + #else 920 + printf("id: '%s' s:%u", sinfo.product, sinfo.sector_size); 921 + #endif 922 + #endif 914 923 struct partinfo pinfo; 915 924 printf("No partition found"); 916 925 for (int i = 0 ; i < NUM_VOLUMES ; i++) {
+10
bootloader/ipod.c
··· 34 34 #include "ata.h" 35 35 #include "file_internal.h" 36 36 #include "disk.h" 37 + #include "storage.h" 37 38 #include "font.h" 38 39 #include "adc.h" 39 40 #include "backlight.h" ··· 364 365 rc = disk_mount_all(); 365 366 if (rc<=0) 366 367 { 368 + #ifdef STORAGE_GET_INFO 369 + struct storage_info sinfo; 370 + storage_get_info(0, &sinfo); 371 + #ifdef MAX_PHYS_SECTOR_SIZE 372 + printf("id: '%s' s:%u*%u", sinfo.product, sinfo.sector_size, sinfo.phys_sector_mult); 373 + #else 374 + printf("id: '%s' s:%u", sinfo.product, sinfo.sector_size); 375 + #endif 376 + #endif 367 377 for (int i = 0 ; i < NUM_VOLUMES ; i++) { 368 378 disk_partinfo(i, &pinfo); 369 379 if (pinfo.type)
+7 -2
firmware/drivers/ata-common.c
··· 30 30 static int spinup_time = 0; 31 31 static struct mutex ata_mutex SHAREDBSS_ATTR; 32 32 33 + #ifdef MAX_PHYS_SECTOR_SIZE 34 + static uint16_t phys_sector_mult = 1; 35 + #endif 36 + 33 37 int ata_spinup_time(void) 34 38 { 35 39 return spinup_time; ··· 49 53 50 54 info->sector_size = log_sector_size; 51 55 info->num_sectors = total_sectors; 56 + #ifdef MAX_PHYS_SECTOR_SIZE 57 + info->phys_sector_mult = phys_sector_mult; 58 + #endif 52 59 53 60 src = (unsigned short*)&identify_info[27]; 54 61 dest = (unsigned short*)vendor; ··· 70 77 } 71 78 #endif 72 79 73 - 74 80 #ifdef MAX_PHYS_SECTOR_SIZE 75 81 76 82 #ifdef MAX_VARIABLE_LOG_SECTOR ··· 90 96 }; 91 97 /* buffer for reading and writing large physical sectors */ 92 98 static struct sector_cache_entry sector_cache STORAGE_ALIGN_ATTR; 93 - static uint16_t phys_sector_mult = 1; 94 99 95 100 static int ata_transfer_sectors(uint64_t start, 96 101 int incount,
+3
firmware/export/storage.h
··· 108 108 { 109 109 unsigned int sector_size; 110 110 sector_t num_sectors; 111 + #ifdef MAX_PHYS_SECTOR_SIZE 112 + uint16_t phys_sector_mult; 113 + #endif 111 114 char *vendor; 112 115 char *product; 113 116 char *revision;