File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
src/portable/synopsys/dwc2 Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 11/*
22 * The MIT License (MIT)
33 *
4- * Copyright (c) 2024 Ha Thach (tinyusb.org)
4+ * Copyright (c) 2024-2025 Ha Thach (tinyusb.org)
55 *
66 * Permission is hereby granted, free of charge, to any person obtaining a copy
77 * of this software and associated documentation files (the "Software"), to deal
4444//
4545//--------------------------------------------------------------------
4646static void reset_core (dwc2_regs_t * dwc2 ) {
47+ // load gsnpsid (it is not readable after reset is asserted)
48+ uint32_t gsnpsid = dwc2 -> gsnpsid ;
49+
4750 // reset core
4851 dwc2 -> grstctl |= GRSTCTL_CSRST ;
4952
50- if ((dwc2 -> gsnpsid & DWC2_CORE_REV_MASK ) < (DWC2_CORE_REV_4_20a & DWC2_CORE_REV_MASK )) {
51- // prior v42.0 CSRST is self-clearing
53+ if ((gsnpsid & DWC2_CORE_REV_MASK ) < (DWC2_CORE_REV_4_20a & DWC2_CORE_REV_MASK )) {
54+ // prior v4.20a CSRST is self-clearing
5255 while (dwc2 -> grstctl & GRSTCTL_CSRST ) {}
5356 } else {
5457 // From v4.20a CSRST bit is write only, CSRT_DONE (w1c) is introduced for checking.
You can’t perform that action at this time.
0 commit comments