diff --git a/apollo_fpga/__init__.py b/apollo_fpga/__init__.py index 9450eab..c84a8f6 100644 --- a/apollo_fpga/__init__.py +++ b/apollo_fpga/__init__.py @@ -46,10 +46,10 @@ class ApolloDebugger: if os.getenv("LUNA_USB_IDS"): LUNA_USB_IDS += [tuple([int(x, 16) for x in os.getenv("LUNA_USB_IDS").split(":")])] - REQUEST_SET_LED_PATTERN = 0xa1 - REQUEST_RECONFIGURE = 0xc0 - REQUEST_FORCE_FPGA_OFFLINE = 0xc1 - REQUEST_HONOR_FPGA_ADV = 0xc2 + REQUEST_SET_LED_PATTERN = 0xa1 + REQUEST_RECONFIGURE = 0xc0 + REQUEST_FORCE_FPGA_OFFLINE = 0xc1 + REQUEST_ALLOW_FPGA_TAKEOVER_USB = 0xc2 LED_PATTERN_IDLE = 500 LED_PATTERN_UPLOAD = 50 @@ -294,9 +294,9 @@ def force_fpga_offline(self): """ Resets the target (FPGA/etc) connected to the debug controller. """ self.out_request(self.REQUEST_FORCE_FPGA_OFFLINE) - def honor_fpga_adv(self): - """ Tell Apollo to honor requests from FPGA_ADV again. Useful after reconfiguration. """ - self.out_request(self.REQUEST_HONOR_FPGA_ADV) + def allow_fpga_takeover_usb(self): + """ Request Apollo to allow FPGA takeover of the USB port. Useful after reconfiguration. """ + self.out_request(self.REQUEST_ALLOW_FPGA_TAKEOVER_USB) def close(self): """ Closes the USB device so it can be reused, possibly by another ApolloDebugger """ diff --git a/apollo_fpga/commands/cli.py b/apollo_fpga/commands/cli.py index d6164e8..1e153f5 100755 --- a/apollo_fpga/commands/cli.py +++ b/apollo_fpga/commands/cli.py @@ -133,7 +133,7 @@ def configure_fpga(device, args): programmer.configure(bitstream) # Let the LUNA gateware take over in devices with shared USB port - device.honor_fpga_adv() + device.allow_fpga_takeover_usb() def ensure_unconfigured(device): @@ -194,7 +194,7 @@ def program_flash_fast(device, args): programmer.configure(products.get("top.bit")) # Let the LUNA gateware take over in devices with shared USB port - device.honor_fpga_adv() + device.allow_fpga_takeover_usb() # Wait for flash bridge enumeration time.sleep(2) @@ -260,7 +260,7 @@ def reconfigure_fpga(device, args): device.soft_reset() # Let the LUNA gateware take over in devices with shared USB port - device.honor_fpga_adv() + device.allow_fpga_takeover_usb() def force_fpga_offline(device, args): diff --git a/firmware/src/boards/cynthion_d11/fpga_adv.c b/firmware/src/boards/cynthion_d11/fpga_adv.c index 9588d2f..81213c6 100644 --- a/firmware/src/boards/cynthion_d11/fpga_adv.c +++ b/firmware/src/boards/cynthion_d11/fpga_adv.c @@ -122,9 +122,9 @@ void fpga_adv_task(void) } /** - * Honor requests from FPGA_ADV again + * Allow FPGA takeover of the USB port */ -void honor_fpga_adv(void) +void allow_fpga_takeover_usb(void) { #ifdef BOARD_HAS_USB_SWITCH if (fpga_requesting_port()) { diff --git a/firmware/src/boards/cynthion_d21/fpga_adv.c b/firmware/src/boards/cynthion_d21/fpga_adv.c index 5a62561..43cd6a5 100644 --- a/firmware/src/boards/cynthion_d21/fpga_adv.c +++ b/firmware/src/boards/cynthion_d21/fpga_adv.c @@ -23,9 +23,9 @@ void fpga_adv_task(void) } /** - * Honor requests from FPGA_ADV again + * Allow FPGA takeover of the USB port */ -void honor_fpga_adv(void) +void allow_fpga_takeover_usb(void) { } diff --git a/firmware/src/boards/daisho/fpga_adv.c b/firmware/src/boards/daisho/fpga_adv.c index 5a62561..43cd6a5 100644 --- a/firmware/src/boards/daisho/fpga_adv.c +++ b/firmware/src/boards/daisho/fpga_adv.c @@ -23,9 +23,9 @@ void fpga_adv_task(void) } /** - * Honor requests from FPGA_ADV again + * Allow FPGA takeover of the USB port */ -void honor_fpga_adv(void) +void allow_fpga_takeover_usb(void) { } diff --git a/firmware/src/boards/qtpy/fpga_adv.c b/firmware/src/boards/qtpy/fpga_adv.c index 5a62561..43cd6a5 100644 --- a/firmware/src/boards/qtpy/fpga_adv.c +++ b/firmware/src/boards/qtpy/fpga_adv.c @@ -23,9 +23,9 @@ void fpga_adv_task(void) } /** - * Honor requests from FPGA_ADV again + * Allow FPGA takeover of the USB port */ -void honor_fpga_adv(void) +void allow_fpga_takeover_usb(void) { } diff --git a/firmware/src/boards/samd11_xplained/fpga_adv.c b/firmware/src/boards/samd11_xplained/fpga_adv.c index 5a62561..43cd6a5 100644 --- a/firmware/src/boards/samd11_xplained/fpga_adv.c +++ b/firmware/src/boards/samd11_xplained/fpga_adv.c @@ -23,9 +23,9 @@ void fpga_adv_task(void) } /** - * Honor requests from FPGA_ADV again + * Allow FPGA takeover of the USB port */ -void honor_fpga_adv(void) +void allow_fpga_takeover_usb(void) { } diff --git a/firmware/src/fpga_adv.h b/firmware/src/fpga_adv.h index 1585230..e9cbb31 100644 --- a/firmware/src/fpga_adv.h +++ b/firmware/src/fpga_adv.h @@ -21,9 +21,9 @@ void fpga_adv_init(void); void fpga_adv_task(void); /** - * Honor requests from FPGA_ADV again + * Allow FPGA takeover of the USB port */ -void honor_fpga_adv(void); +void allow_fpga_takeover_usb(void); /** * True if we received an advertisement message within the last time window. diff --git a/firmware/src/vendor.c b/firmware/src/vendor.c index f027704..c06ef48 100644 --- a/firmware/src/vendor.c +++ b/firmware/src/vendor.c @@ -46,7 +46,7 @@ enum { // General programming requests. VENDOR_REQUEST_TRIGGER_RECONFIGURATION = 0xc0, VENDOR_REQUEST_FORCE_FPGA_OFFLINE = 0xc1, - VENDOR_REQUEST_HONOR_FPGA_ADV = 0xc2, + VENDOR_REQUEST_ALLOW_FPGA_TAKEOVER_USB = 0xc2, // @@ -142,16 +142,16 @@ bool handle_force_fpga_offline(uint8_t rhport, tusb_control_request_t const* req /** - * Request Apollo to honor FPGA advertisement messages. + * Request Apollo to allow FPGA takeover of the USB port. */ -bool handle_honor_fpga_adv(uint8_t rhport, tusb_control_request_t const* request) +bool handle_allow_fpga_takeover_usb(uint8_t rhport, tusb_control_request_t const* request) { return tud_control_xfer(rhport, request, NULL, 0); } -bool handle_honor_fpga_adv_finish(uint8_t rhport, tusb_control_request_t const* request) +bool handle_allow_fpga_takeover_usb_finish(uint8_t rhport, tusb_control_request_t const* request) { - honor_fpga_adv(); + allow_fpga_takeover_usb(); return true; } @@ -169,8 +169,8 @@ static bool handle_vendor_request_setup(uint8_t rhport, tusb_control_request_t c return handle_trigger_fpga_reconfiguration(rhport, request); case VENDOR_REQUEST_FORCE_FPGA_OFFLINE: return handle_force_fpga_offline(rhport, request); - case VENDOR_REQUEST_HONOR_FPGA_ADV: - return handle_honor_fpga_adv(rhport, request); + case VENDOR_REQUEST_ALLOW_FPGA_TAKEOVER_USB: + return handle_allow_fpga_takeover_usb(rhport, request); // JTAG requests case VENDOR_REQUEST_JTAG_CLEAR_OUT_BUFFER: @@ -250,8 +250,8 @@ static bool handle_vendor_request_complete(uint8_t rhport, tusb_control_request_ static bool handle_vendor_request_finish(uint8_t rhport, tusb_control_request_t const * request) { switch (request->bRequest) { - case VENDOR_REQUEST_HONOR_FPGA_ADV: - return handle_honor_fpga_adv_finish(rhport, request); + case VENDOR_REQUEST_ALLOW_FPGA_TAKEOVER_USB: + return handle_allow_fpga_takeover_usb_finish(rhport, request); default: return true; }