From 761e7987c8dec314800eb6a099aad139a12a12a9 Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Thu, 8 Jan 2015 22:30:22 +0100 Subject: usb: finally get rid of USE_ROCKBOX_USB in Sansa bootloader, use bootloader usb For some reason, the bootloader and config files didn't define HAVE_BOOTLOADER_USB_MODE, also remove the special cases in usb.c which they implied. Change-Id: I68c29be7d03627e64cac4ff7678e0c211e087a8c --- bootloader/sansa_as3525.c | 16 ++++++++-------- firmware/export/config/sansac200v2.h | 1 + firmware/export/config/sansaclip.h | 1 + firmware/export/config/sansaclipplus.h | 2 +- firmware/export/config/sansaclipv2.h | 1 + firmware/export/config/sansaclipzip.h | 2 +- firmware/export/config/sansae200v2.h | 1 + firmware/export/config/sansafuze.h | 1 + firmware/export/config/sansafuzev2.h | 1 + firmware/export/config/sansam200v4.h | 1 + firmware/usb.c | 4 +--- 11 files changed, 18 insertions(+), 13 deletions(-) diff --git a/bootloader/sansa_as3525.c b/bootloader/sansa_as3525.c index 3558d01674..14cb2ab7a5 100644 --- a/bootloader/sansa_as3525.c +++ b/bootloader/sansa_as3525.c @@ -29,10 +29,10 @@ #include "gcc_extensions.h" #include "../kernel-internal.h" #include "lcd.h" -#ifdef USE_ROCKBOX_USB +#ifdef HAVE_BOOTLOADER_USB_MODE #include "usb.h" #include "sysfont.h" -#endif /* USE_ROCKBOX_USB */ +#endif /* HAVE_BOOTLOADER_USB_MODE */ #include "backlight.h" #include "button-target.h" #include "common.h" @@ -46,7 +46,7 @@ void show_logo(void); -#ifdef USE_ROCKBOX_USB +#ifdef HAVE_BOOTLOADER_USB_MODE static void usb_mode(void) { if(usb_detect() != USB_INSERTED) @@ -73,7 +73,7 @@ static void usb_mode(void) reset_screen(); lcd_update(); } -#endif /* USE_ROCKBOX_USB */ +#endif /* HAVE_BOOTLOADER_USB_MODE */ void main(void) NORETURN_ATTR; void main(void) @@ -122,7 +122,7 @@ void main(void) filesystem_init(); -#ifdef USE_ROCKBOX_USB +#ifdef HAVE_BOOTLOADER_USB_MODE usb_init(); /* Enter USB mode if USB is plugged and SELECT button is pressed */ @@ -131,11 +131,11 @@ void main(void) if(usb_detect() == USB_INSERTED) usb_mode(); } -#endif /* USE_ROCKBOX_USB */ +#endif /* HAVE_BOOTLOADER_USB_MODE */ while((ret = disk_mount_all()) <= 0) { -#ifdef USE_ROCKBOX_USB +#ifdef HAVE_BOOTLOADER_USB_MODE error(EDISK, ret, false); usb_mode(); #else @@ -150,7 +150,7 @@ void main(void) while((ret = load_firmware(loadbuffer, BOOTFILE, buffer_size)) <= EFILE_EMPTY) { -#ifdef USE_ROCKBOX_USB +#ifdef HAVE_BOOTLOADER_USB_MODE error(EBOOTFILE, ret, false); usb_mode(); #else diff --git a/firmware/export/config/sansac200v2.h b/firmware/export/config/sansac200v2.h index 9e9c8b835f..0da8b6a67b 100644 --- a/firmware/export/config/sansac200v2.h +++ b/firmware/export/config/sansac200v2.h @@ -187,6 +187,7 @@ //#define USB_ENABLE_SERIAL #define USB_VENDOR_ID 0x0781 #define USB_PRODUCT_ID 0x7452 +#define HAVE_BOOTLOADER_USB_MODE #define HAVE_USB_HID_MOUSE /* Define this if you have adjustable CPU frequency */ diff --git a/firmware/export/config/sansaclip.h b/firmware/export/config/sansaclip.h index 54500402d7..43a24cb5c4 100644 --- a/firmware/export/config/sansaclip.h +++ b/firmware/export/config/sansaclip.h @@ -182,6 +182,7 @@ #define USB_VENDOR_ID 0x0781 #define USB_PRODUCT_ID 0x7433 #define HAVE_USB_HID_MOUSE +#define HAVE_BOOTLOADER_USB_MODE /* Define this if you have adjustable CPU frequency */ #define HAVE_ADJUSTABLE_CPU_FREQ diff --git a/firmware/export/config/sansaclipplus.h b/firmware/export/config/sansaclipplus.h index dc9ad90b5b..a2df3d21c8 100644 --- a/firmware/export/config/sansaclipplus.h +++ b/firmware/export/config/sansaclipplus.h @@ -188,7 +188,7 @@ #define HAVE_USBSTACK #define USB_VENDOR_ID 0x0781 #define USB_PRODUCT_ID 0x74d1 - +#define HAVE_BOOTLOADER_USB_MODE /* Virtual LED (icon) */ #define CONFIG_LED LED_VIRTUAL diff --git a/firmware/export/config/sansaclipv2.h b/firmware/export/config/sansaclipv2.h index a61d5ba18c..8b0b84c1d0 100644 --- a/firmware/export/config/sansaclipv2.h +++ b/firmware/export/config/sansaclipv2.h @@ -184,6 +184,7 @@ #define HAVE_USBSTACK #define USB_VENDOR_ID 0x0781 #define USB_PRODUCT_ID 0x7435 +#define HAVE_BOOTLOADER_USB_MODE /* Virtual LED (icon) */ #define CONFIG_LED LED_VIRTUAL diff --git a/firmware/export/config/sansaclipzip.h b/firmware/export/config/sansaclipzip.h index 50147b9714..9743261a52 100644 --- a/firmware/export/config/sansaclipzip.h +++ b/firmware/export/config/sansaclipzip.h @@ -187,7 +187,7 @@ #define HAVE_USBSTACK #define USB_VENDOR_ID 0x0781 #define USB_PRODUCT_ID 0x74e5 - +#define HAVE_BOOTLOADER_USB_MODE /* Virtual LED (icon) */ #define CONFIG_LED LED_VIRTUAL diff --git a/firmware/export/config/sansae200v2.h b/firmware/export/config/sansae200v2.h index 23bee8c98a..3541e0f107 100644 --- a/firmware/export/config/sansae200v2.h +++ b/firmware/export/config/sansae200v2.h @@ -204,6 +204,7 @@ #define USB_VENDOR_ID 0x0781 #define USB_PRODUCT_ID 0x7423 #define HAVE_USB_HID_MOUSE +#define HAVE_BOOTLOADER_USB_MODE /* Define this if you have adjustable CPU frequency */ #define HAVE_ADJUSTABLE_CPU_FREQ diff --git a/firmware/export/config/sansafuze.h b/firmware/export/config/sansafuze.h index b2cdf061dd..f15d424c1b 100644 --- a/firmware/export/config/sansafuze.h +++ b/firmware/export/config/sansafuze.h @@ -205,6 +205,7 @@ #define USB_VENDOR_ID 0x0781 #define USB_PRODUCT_ID 0x74c1 #define HAVE_USB_HID_MOUSE +#define HAVE_BOOTLOADER_USB_MODE /* Define this if you have adjustable CPU frequency */ #define HAVE_ADJUSTABLE_CPU_FREQ diff --git a/firmware/export/config/sansafuzev2.h b/firmware/export/config/sansafuzev2.h index a0197bfb41..f53c287d87 100644 --- a/firmware/export/config/sansafuzev2.h +++ b/firmware/export/config/sansafuzev2.h @@ -205,6 +205,7 @@ #define HAVE_USBSTACK #define USB_VENDOR_ID 0x0781 #define USB_PRODUCT_ID 0x74c3 /* MSC = 0x74c3, MTP = 0x74c2 */ +#define HAVE_BOOTLOADER_USB_MODE /* Define this if you have adjustable CPU frequency */ //#define HAVE_ADJUSTABLE_CPU_FREQ diff --git a/firmware/export/config/sansam200v4.h b/firmware/export/config/sansam200v4.h index 99e84e65e0..d905d10c95 100644 --- a/firmware/export/config/sansam200v4.h +++ b/firmware/export/config/sansam200v4.h @@ -148,6 +148,7 @@ #define USB_VENDOR_ID 0x0781 #define USB_PRODUCT_ID 0x7431 #define HAVE_USB_HID_MOUSE +#define HAVE_BOOTLOADER_USB_MODE #define CONFIG_LCD LCD_SSD1815 diff --git a/firmware/usb.c b/firmware/usb.c index e5210efc11..ee6ed2c12c 100644 --- a/firmware/usb.c +++ b/firmware/usb.c @@ -48,10 +48,8 @@ (defined(HAVE_USBSTACK) && defined(HAVE_BOOTLOADER_USB_MODE)) || \ (defined(HAVE_USBSTACK) && (defined(CREATIVE_ZVx))) || \ (defined(HAVE_USBSTACK) && (defined(OLYMPUS_MROBE_500))) || \ - (defined(HAVE_USBSTACK) && CONFIG_USBOTG == USBOTG_S3C6400X) || \ defined(CPU_TCC77X) || defined(CPU_TCC780X) || \ - (CONFIG_USBOTG == USBOTG_JZ4740) || \ - (defined(HAVE_USBSTACK) && CONFIG_USBOTG == USBOTG_AS3525) + (CONFIG_USBOTG == USBOTG_JZ4740) #define USB_FULL_INIT #endif -- cgit v1.2.3