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