From d6e822cab9b4f1294a8789632c737d0d8f71ef58 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Wed, 11 Apr 2007 21:26:58 +0000 Subject: Get rid of some old archos debug cruft (USB polarity, PR polarity and ATA address are all derived from the hw mask, and master/slave isn't displayed on other targets either). * Get rid of all the USB*STYLE macros (except USB_IPODSTYLE). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13112 a1c6a512-1295-4272-9138-f99709370657 --- apps/debug_menu.c | 90 +++++++--------------------------- firmware/export/config-fmrecorder.h | 3 -- firmware/export/config-gigabeat.h | 2 - firmware/export/config-h100.h | 2 - firmware/export/config-h120.h | 2 - firmware/export/config-h300.h | 2 - firmware/export/config-iaudiom5.h | 4 +- firmware/export/config-iaudiox5.h | 2 - firmware/export/config-ondiofm.h | 6 --- firmware/export/config-ondiosp.h | 6 --- firmware/export/config-player.h | 3 -- firmware/export/config-recorder.h | 3 -- firmware/export/config-recorderv2.h | 3 -- firmware/target/sh/archos/ata-archos.c | 7 --- firmware/target/sh/archos/ata-target.h | 1 - 15 files changed, 19 insertions(+), 117 deletions(-) diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 48e67b575b..682bcaf456 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c @@ -121,8 +121,6 @@ static bool dbg_list(char *title, int count, int selection_size, /*---------------------------------------------------*/ /* SPECIAL DEBUG STUFF */ /*---------------------------------------------------*/ -extern int ata_device; -extern int ata_io_address; extern struct thread_entry threads[MAXTHREADS]; @@ -407,8 +405,6 @@ static bool dbg_hw_info(void) { #if CONFIG_CPU == SH7034 char buf[32]; - int usb_polarity; - int pr_polarity; int bitmask = *(unsigned short*)0x20000fc; int rom_version = *(unsigned short*)0x20000fe; unsigned manu, id; /* flash IDs */ @@ -417,20 +413,6 @@ static bool dbg_hw_info(void) bool has_bootrom; /* flag for boot ROM present */ int oldmode; /* saved memory guard mode */ -#ifdef USB_ENABLE_ONDIOSTYLE - if(PADRL & 0x20) -#else - if(PADRH & 0x04) -#endif - usb_polarity = 0; /* Negative */ - else - usb_polarity = 1; /* Positive */ - - if(PADRH & 0x08) - pr_polarity = 0; /* Negative */ - else - pr_polarity = 1; /* Positive */ - oldmode = system_memory_guard(MEMGUARD_NONE); /* disable memory guard */ /* get flash ROM type */ @@ -460,17 +442,11 @@ static bool dbg_hw_info(void) snprintf(buf, 32, "Mask: 0x%04x", bitmask); lcd_puts(0, 2, buf); - snprintf(buf, 32, "USB: %s", usb_polarity?"positive":"negative"); - lcd_puts(0, 3, buf); - - snprintf(buf, 32, "PR: %s", pr_polarity?"positive":"negative"); - lcd_puts(0, 4, buf); - if (got_id) snprintf(buf, 32, "Flash: M=%02x D=%02x", manu, id); else snprintf(buf, 32, "Flash: M=?? D=??"); /* unknown, sorry */ - lcd_puts(0, 5, buf); + lcd_puts(0, 3, buf); if (has_bootrom) { @@ -483,13 +459,8 @@ static bool dbg_hw_info(void) { snprintf(buf, 32, "Boot ROM: none"); } - lcd_puts(0, 6, buf); + lcd_puts(0, 4, buf); -#ifndef HAVE_MMC /* have ATA */ - snprintf(buf, 32, "ATA: 0x%x,%s", ata_io_address, - ata_device ? "slave":"master"); - lcd_puts(0, 7, buf); -#endif lcd_update(); while(1) @@ -593,8 +564,6 @@ static bool dbg_hw_info(void) char buf[32]; int button; int currval = 0; - int usb_polarity; - int bitmask = *(unsigned short*)0x20000fc; int rom_version = *(unsigned short*)0x20000fe; unsigned manu, id; /* flash IDs */ bool got_id; /* flag if we managed to get the flash IDs */ @@ -602,11 +571,6 @@ static bool dbg_hw_info(void) bool has_bootrom; /* flag for boot ROM present */ int oldmode; /* saved memory guard mode */ - if(PADRH & 0x04) - usb_polarity = 0; /* Negative */ - else - usb_polarity = 1; /* Positive */ - oldmode = system_memory_guard(MEMGUARD_NONE); /* disable memory guard */ /* get flash ROM type */ @@ -636,23 +600,12 @@ static bool dbg_hw_info(void) rom_version/100, rom_version%100); break; case 1: - snprintf(buf, 32, "USB: %s", - usb_polarity?"pos":"neg"); - break; - case 2: - snprintf(buf, 32, "ATA: 0x%x%s", - ata_io_address, ata_device ? "s":"m"); - break; - case 3: - snprintf(buf, 32, "Mask: %04x", bitmask); - break; - case 4: if (got_id) snprintf(buf, 32, "Flash:%02x,%02x", manu, id); else snprintf(buf, 32, "Flash:??,??"); /* unknown, sorry */ break; - case 5: + case 2: if (has_bootrom) { if (rom_crc == 0x56DBA4EE) /* known Version 1 */ @@ -681,12 +634,12 @@ static bool dbg_hw_info(void) case ACTION_SETTINGS_DEC: currval--; if(currval < 0) - currval = 5; + currval = 2; break; case ACTION_SETTINGS_INC: currval++; - if(currval > 5) + if(currval > 2) currval = 0; break; } @@ -968,11 +921,7 @@ bool dbg_ports(void) snprintf(buf, 32, "Batt: %d.%02dV %d%% ", adc_battery_voltage / 100, adc_battery_voltage % 100, adc_battery_level); lcd_puts(0, 6, buf); -#ifndef HAVE_MMC /* have ATA */ - snprintf(buf, 32, "ATA: %s, 0x%x", - ata_device?"slave":"master", ata_io_address); - lcd_puts(0, 7, buf); -#endif + lcd_update(); if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) return false; @@ -1208,38 +1157,35 @@ bool dbg_ports(void) switch(currval) { case 0: - snprintf(buf, 32, "PADR: %04x ", porta); + snprintf(buf, 32, "PADR: %04x", porta); break; case 1: - snprintf(buf, 32, "PBDR: %04x ", portb); + snprintf(buf, 32, "PBDR: %04x", portb); break; case 2: - snprintf(buf, 32, "AN0: %03x ", adc_read(0)); + snprintf(buf, 32, "AN0: %03x", adc_read(0)); break; case 3: - snprintf(buf, 32, "AN1: %03x ", adc_read(1)); + snprintf(buf, 32, "AN1: %03x", adc_read(1)); break; case 4: - snprintf(buf, 32, "AN2: %03x ", adc_read(2)); + snprintf(buf, 32, "AN2: %03x", adc_read(2)); break; case 5: - snprintf(buf, 32, "AN3: %03x ", adc_read(3)); + snprintf(buf, 32, "AN3: %03x", adc_read(3)); break; case 6: - snprintf(buf, 32, "AN4: %03x ", adc_read(4)); + snprintf(buf, 32, "AN4: %03x", adc_read(4)); break; case 7: - snprintf(buf, 32, "AN5: %03x ", adc_read(5)); + snprintf(buf, 32, "AN5: %03x", adc_read(5)); break; case 8: - snprintf(buf, 32, "AN6: %03x ", adc_read(6)); + snprintf(buf, 32, "AN6: %03x", adc_read(6)); break; case 9: - snprintf(buf, 32, "AN7: %03x ", adc_read(7)); + snprintf(buf, 32, "AN7: %03x", adc_read(7)); break; - case 10: - snprintf(buf, 32, "%s, 0x%x ", - ata_device?"slv":"mst", ata_io_address); break; } lcd_puts(0, 0, buf); @@ -1261,12 +1207,12 @@ bool dbg_ports(void) case ACTION_SETTINGS_DEC: currval--; if(currval < 0) - currval = 10; + currval = 9; break; case ACTION_SETTINGS_INC: currval++; - if(currval > 10) + if(currval > 9) currval = 0; break; } diff --git a/firmware/export/config-fmrecorder.h b/firmware/export/config-fmrecorder.h index d40fd01198..e753808897 100644 --- a/firmware/export/config-fmrecorder.h +++ b/firmware/export/config-fmrecorder.h @@ -99,9 +99,6 @@ /* FM recorders can wake up from RTC alarm */ #define HAVE_RTC_ALARM -/* How to detect USB */ -#define USB_FMRECORDERSTYLE 1 - /* Hardware controlled charging with monitoring */ #define CONFIG_CHARGING CHARGING_MONITOR diff --git a/firmware/export/config-gigabeat.h b/firmware/export/config-gigabeat.h index 588c92df6d..9b56a1a616 100644 --- a/firmware/export/config-gigabeat.h +++ b/firmware/export/config-gigabeat.h @@ -124,8 +124,6 @@ /* Offset ( in the firmware file's header ) to the real data */ #define FIRMWARE_OFFSET_FILE_DATA 8 -#define USB_GIGABEAT_STYLE - #define HAVE_HEADPHONE_DETECTION /* Define this if you have adjustable CPU frequency */ diff --git a/firmware/export/config-h100.h b/firmware/export/config-h100.h index 84ca26ba53..dbb499f3af 100644 --- a/firmware/export/config-h100.h +++ b/firmware/export/config-h100.h @@ -135,8 +135,6 @@ /* Offset ( in the firmware file's header ) to the real data */ #define FIRMWARE_OFFSET_FILE_DATA 8 -#define USB_IRIVERSTYLE - #define HAVE_ATA_LED_CTRL /* Define this if you have adjustable CPU frequency */ diff --git a/firmware/export/config-h120.h b/firmware/export/config-h120.h index ebde63f260..f957f450d0 100644 --- a/firmware/export/config-h120.h +++ b/firmware/export/config-h120.h @@ -128,8 +128,6 @@ /* Offset ( in the firmware file's header ) to the real data */ #define FIRMWARE_OFFSET_FILE_DATA 8 -#define USB_IRIVERSTYLE - #define HAVE_ATA_LED_CTRL /* Define this if you have adjustable CPU frequency */ diff --git a/firmware/export/config-h300.h b/firmware/export/config-h300.h index 173b99e432..ad80191885 100644 --- a/firmware/export/config-h300.h +++ b/firmware/export/config-h300.h @@ -127,8 +127,6 @@ /* Offset ( in the firmware file's header ) to the real data */ #define FIRMWARE_OFFSET_FILE_DATA 8 -#define USB_IRIVERSTYLE - /* USB On-the-go */ #define CONFIG_USBOTG USBOTG_ISP1362 diff --git a/firmware/export/config-iaudiom5.h b/firmware/export/config-iaudiom5.h index d6e4195216..bce3c47e5c 100644 --- a/firmware/export/config-iaudiom5.h +++ b/firmware/export/config-iaudiom5.h @@ -126,14 +126,12 @@ /* Offset ( in the firmware file's header ) to the real data */ #define FIRMWARE_OFFSET_FILE_DATA 8 -#define USB_X5M5_STYLE - /* Define this if you have adjustable CPU frequency */ #define HAVE_ADJUSTABLE_CPU_FREQ #define BOOTFILE_EXT "iaudio" #define BOOTFILE "rockbox." BOOTFILE_EXT -#define BOOTDIR "/.rockbox" +#define BOOTDIR "/.rockbox" #define BOOTLOADER_ENTRYPOINT 0x001F0000 #define FLASH_ENTRYPOINT 0x00001000 diff --git a/firmware/export/config-iaudiox5.h b/firmware/export/config-iaudiox5.h index adcbfee551..57f8a68134 100644 --- a/firmware/export/config-iaudiox5.h +++ b/firmware/export/config-iaudiox5.h @@ -141,8 +141,6 @@ /* Offset ( in the firmware file's header ) to the real data */ #define FIRMWARE_OFFSET_FILE_DATA 8 -#define USB_X5M5_STYLE - /* USB On-the-go */ #define CONFIG_USBOTG USBOTG_M5636 diff --git a/firmware/export/config-ondiofm.h b/firmware/export/config-ondiofm.h index fbc0c0e098..0e691b70e3 100644 --- a/firmware/export/config-ondiofm.h +++ b/firmware/export/config-ondiofm.h @@ -78,12 +78,6 @@ /* Define this if the tuner is switched on by software */ #define HAVE_TUNER_PWR_CTRL -/* How to detect USB */ -#define USB_FMRECORDERSTYLE 1 /* like FM, on AN1 */ - -/* How to enable USB */ -#define USB_ENABLE_ONDIOSTYLE 1 /* with PA5 */ - /* The start address index for ROM builds */ /* #define ROM_START 0x16010 for behind original Archos */ #define ROM_START 0x7010 /* for behind BootBox */ diff --git a/firmware/export/config-ondiosp.h b/firmware/export/config-ondiosp.h index cefbbc3666..da723413ec 100644 --- a/firmware/export/config-ondiosp.h +++ b/firmware/export/config-ondiosp.h @@ -65,12 +65,6 @@ /* Offset ( in the firmware file's header ) to the real data */ #define FIRMWARE_OFFSET_FILE_DATA 24 -/* How to detect USB */ -#define USB_FMRECORDERSTYLE 1 /* like FM, on AN1 */ - -/* How to enable USB */ -#define USB_ENABLE_ONDIOSTYLE 1 /* with PA5 */ - /* The start address index for ROM builds */ /* #define ROM_START 0x12010 for behind original Archos */ #define ROM_START 0x7010 /* for behind BootBox */ diff --git a/firmware/export/config-player.h b/firmware/export/config-player.h index c461402eb1..580831c861 100644 --- a/firmware/export/config-player.h +++ b/firmware/export/config-player.h @@ -74,9 +74,6 @@ /* Offset ( in the firmware file's header ) to the real data */ #define FIRMWARE_OFFSET_FILE_DATA 6 -/* How to detect USB */ -#define USB_PLAYERSTYLE 1 - /* Hardware controlled charging */ #define CONFIG_CHARGING CHARGING_SIMPLE diff --git a/firmware/export/config-recorder.h b/firmware/export/config-recorder.h index 3c53055886..d8bd0bed2f 100644 --- a/firmware/export/config-recorder.h +++ b/firmware/export/config-recorder.h @@ -86,9 +86,6 @@ /* Offset ( in the firmware file's header ) to the real data */ #define FIRMWARE_OFFSET_FILE_DATA 6 -/* How to detect USB */ -#define USB_RECORDERSTYLE 1 - /* Software controlled charging */ #define CONFIG_CHARGING CHARGING_CONTROL diff --git a/firmware/export/config-recorderv2.h b/firmware/export/config-recorderv2.h index 1d64f586ac..0e6e00c167 100644 --- a/firmware/export/config-recorderv2.h +++ b/firmware/export/config-recorderv2.h @@ -99,9 +99,6 @@ /* Define this if you have an FM Radio */ #define CONFIG_TUNER S1A0903X01 -/* How to detect USB */ -#define USB_FMRECORDERSTYLE 1 - /* Hardware controlled charging with monitoring */ #define CONFIG_CHARGING CHARGING_MONITOR diff --git a/firmware/target/sh/archos/ata-archos.c b/firmware/target/sh/archos/ata-archos.c index c685700fa3..5ad30d6891 100644 --- a/firmware/target/sh/archos/ata-archos.c +++ b/firmware/target/sh/archos/ata-archos.c @@ -29,7 +29,6 @@ #define ATA_CONTROL2 ((volatile unsigned char*)0x06200306) volatile unsigned char* ata_control; -int ata_io_address; /* 0x300 or 0x200 */ void ata_reset(void) { @@ -59,15 +58,9 @@ void ata_device_init(void) PACR2 &= 0xBFFF; /* GPIO function for PA7 (IDE enable) */ if (read_hw_mask() & ATA_ADDRESS_200) - { - ata_io_address = 0x200; /* For debug purposes only */ ata_control = ATA_CONTROL1; - } else - { - ata_io_address = 0x300; /* For debug purposes only */ ata_control = ATA_CONTROL2; - } } bool ata_is_coldstart(void) diff --git a/firmware/target/sh/archos/ata-target.h b/firmware/target/sh/archos/ata-target.h index 77f1f9d232..91585626c6 100644 --- a/firmware/target/sh/archos/ata-target.h +++ b/firmware/target/sh/archos/ata-target.h @@ -64,7 +64,6 @@ #define SET_16BITREG(reg,val) reg = (val) extern volatile unsigned char* ata_control; -extern int ata_io_address; void ata_reset(void); void ata_enable(bool on); -- cgit v1.2.3