-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from mossmann/sideband
Hold Sideband PHY RESET low on older Cynthions
- Loading branch information
Showing
2 changed files
with
23 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// Copyright 2019-2023 Great Scott Gadgets <[email protected]> | ||
// Copyright 2019-2024 Great Scott Gadgets <[email protected]> | ||
// Copyright 2019 Katherine J. Temkin <[email protected]> | ||
// Copyright 2014 Technical Machine, Inc. See the COPYRIGHT | ||
// file at the top-level directory of this distribution. | ||
|
@@ -35,4 +35,12 @@ const static Pin LED_PIN = {.group = 0, .pin = 22, .mux = 0 }; | |
const static Pin PIN_USB_DM = {.group = 0, .pin = 24, .mux = MUX_PA24G_USB_DM }; | ||
const static Pin PIN_USB_DP = {.group = 0, .pin = 25, .mux = MUX_PA25G_USB_DP }; | ||
|
||
// Sideband PHY RESET | ||
#if ((_BOARD_REVISION_MAJOR_ == 0) && (_BOARD_REVISION_MINOR_ < 3)) | ||
const static Pin SIDEBAND_RESET = {.group = 1, .pin = 23, .mux = 0 }; | ||
#elif ((_BOARD_REVISION_MAJOR_ == 0) && (_BOARD_REVISION_MINOR_ < 6)) | ||
const static Pin SIDEBAND_RESET = {.group = 0, .pin = 9, .mux = 0 }; | ||
#endif | ||
|
||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// Copyright 2019-2023 Great Scott Gadgets <[email protected]> | ||
// Copyright 2019-2024 Great Scott Gadgets <[email protected]> | ||
// Copyright 2019 Katherine J. Temkin <[email protected]> | ||
// Copyright 2014 Technical Machine, Inc. See the COPYRIGHT | ||
// file at the top-level directory of this distribution. | ||
|
@@ -66,16 +66,26 @@ void noopFunction(void) | |
void bootloader_main(void) | ||
{ | ||
|
||
#if ((_BOARD_REVISION_MAJOR_ == 0) && (_BOARD_REVISION_MINOR_ < 6)) | ||
// Set up the LED that indicates we're in bootloader mode. | ||
// Set up output pins. | ||
#if ((_BOARD_REVISION_MAJOR_ == 0) && (_BOARD_REVISION_MINOR_ < 3)) | ||
pins_out(0, (1 << LED_PIN.pin), 0); | ||
#elif ((_BOARD_REVISION_MAJOR_ == 0) && (_BOARD_REVISION_MINOR_ < 6)) | ||
pins_out(0, (1 << LED_PIN.pin) | (1 << SIDEBAND_RESET.pin), 0); | ||
#else | ||
// Set up output pins (LED and USB switch control) | ||
pins_out(0, (1 << LED_PIN.pin) | (1 << USB_SWITCH.pin), 0); | ||
|
||
// Take over USB port in board revisions >=0.6 | ||
pin_high(USB_SWITCH); | ||
#endif | ||
/* | ||
* Cynthion r0.3 through r0.5 do not have a USB switch. On these | ||
* platforms the Sideband PHY RESET is pulled low to ensure that it | ||
* does not interfere with the bootloader's use of the Sideband USB | ||
* port. The output is explicitly enabled but implicitly driven low (by | ||
* reset default). Sideband PHY usage is unsupported on Cynthion r0.1 | ||
* and r0.2. | ||
*/ | ||
|
||
|
||
// Set up the main clocks. | ||
clock_init_usb(GCLK_SYSTEM); | ||
|