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
4545//
4646//--------------------------------------------------------------------
4747static void reset_core (dwc2_regs_t * dwc2 ) {
48+ // load gsnpsid (it is not readable after reset is asserted)
49+ uint32_t gsnpsid = dwc2 -> gsnpsid ;
50+
4851 // reset core
4952 dwc2 -> grstctl |= GRSTCTL_CSRST ;
5053
51- if ((dwc2 -> gsnpsid & DWC2_CORE_REV_MASK ) < (DWC2_CORE_REV_4_20a & DWC2_CORE_REV_MASK )) {
52- // prior v42.0 CSRST is self-clearing
54+ if ((gsnpsid & DWC2_CORE_REV_MASK ) < (DWC2_CORE_REV_4_20a & DWC2_CORE_REV_MASK )) {
55+ // prior v4.20a CSRST is self-clearing
5356 while (dwc2 -> grstctl & GRSTCTL_CSRST ) {}
5457 } else {
5558 // 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