From f83d42ce51995daf188d0b12083e7b0f166d236f Mon Sep 17 00:00:00 2001 From: Eric Wild Date: Thu, 28 Oct 2021 18:09:01 +0200 Subject: [PATCH] firmware: remove usb pullup that dates back to simtrace1 All the parts are DNP and never existed on the simtrace2 with sam3; the sam3 has internal pullups that are part of the usb peripheral. Change-Id: I04a703a2eba6ff1dc64692c089213389d0c1066d --- firmware/apps/dfu/main.c | 9 --------- firmware/libboard/octsimtest/include/board.h | 5 ----- firmware/libboard/sam3p256/include/board.h | 5 ----- firmware/libboard/simtrace/include/board.h | 5 ----- firmware/libcommon/source/usb.c | 8 -------- 5 files changed, 32 deletions(-) diff --git a/firmware/apps/dfu/main.c b/firmware/apps/dfu/main.c index d5a6fa65..48138818 100644 --- a/firmware/apps/dfu/main.c +++ b/firmware/apps/dfu/main.c @@ -342,16 +342,7 @@ extern int main(void) TRACE_INFO("USB init...\n\r"); /* Signal USB reset by disabling the pull-up on USB D+ for at least 10 ms */ USBD_Disconnect(); -#ifdef PIN_USB_PULLUP - const Pin usb_dp_pullup = PIN_USB_PULLUP; - PIO_Configure(&usb_dp_pullup, 1); - PIO_Set(&usb_dp_pullup); -#endif mdelay(50); -#ifdef PIN_USB_PULLUP - PIO_Clear(&usb_dp_pullup); -#endif - USBDFU_Initialize(&dfu_descriptors); while (USBD_GetState() < USBD_STATE_CONFIGURED) { diff --git a/firmware/libboard/octsimtest/include/board.h b/firmware/libboard/octsimtest/include/board.h index 530f27b0..697619c2 100644 --- a/firmware/libboard/octsimtest/include/board.h +++ b/firmware/libboard/octsimtest/include/board.h @@ -87,11 +87,6 @@ /* SPI flash write protect pin (active low, pulled low) */ #define PIN_SPI_WP {PA15, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT} -/** Pin configuration to control USB pull-up on D+ - * @details the USB pull-up on D+ is enable by default on the board but can be disabled by setting PA16 high - */ -#define PIN_USB_PULLUP {PIO_PA16, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT} - /** USB definitions */ /* OpenMoko SIMtrace 2 USB vendor ID */ #define BOARD_USB_VENDOR_ID USB_VENDOR_OPENMOKO diff --git a/firmware/libboard/sam3p256/include/board.h b/firmware/libboard/sam3p256/include/board.h index 58e8a241..06cfdced 100644 --- a/firmware/libboard/sam3p256/include/board.h +++ b/firmware/libboard/sam3p256/include/board.h @@ -135,11 +135,6 @@ #define PIN_SPI_WP {PA15, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT} #endif -/** Pin configuration to control USB pull-up on D+ - * @details the USB pull-up on D+ is enable by default on the board but can be disabled by setting PA16 high - */ -#define PIN_USB_PULLUP {PIO_PA16, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT} - /** USB definitions */ /* OpenMoko SIMtrace 2 USB vendor ID */ #define BOARD_USB_VENDOR_ID USB_VENDOR_OPENMOKO diff --git a/firmware/libboard/simtrace/include/board.h b/firmware/libboard/simtrace/include/board.h index be18f64d..6e4cd987 100644 --- a/firmware/libboard/simtrace/include/board.h +++ b/firmware/libboard/simtrace/include/board.h @@ -134,11 +134,6 @@ /* SPI flash write protect pin (active low, pulled low) */ #define PIN_SPI_WP {PA15, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT} -/** Pin configuration to control USB pull-up on D+ - * @details the USB pull-up on D+ is enable by default on the board but can be disabled by setting PA16 high - */ -#define PIN_USB_PULLUP {PIO_PA16, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT} - /** USB definitions */ /* OpenMoko SIMtrace 2 USB vendor ID */ #define BOARD_USB_VENDOR_ID USB_VENDOR_OPENMOKO diff --git a/firmware/libcommon/source/usb.c b/firmware/libcommon/source/usb.c index e75646e5..08682638 100644 --- a/firmware/libcommon/source/usb.c +++ b/firmware/libcommon/source/usb.c @@ -689,16 +689,8 @@ void SIMtrace_USB_Initialize(void) { unsigned int i; /* Signal USB reset by disabling the pull-up on USB D+ for at least 10 ms */ -#ifdef PIN_USB_PULLUP - const Pin usb_dp_pullup = PIN_USB_PULLUP; - PIO_Configure(&usb_dp_pullup, 1); - PIO_Set(&usb_dp_pullup); -#endif USBD_HAL_Suspend(); mdelay(20); -#ifdef PIN_USB_PULLUP - PIO_Clear(&usb_dp_pullup); -#endif USBD_HAL_Activate(); // Get std USB driver