File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -177,6 +177,22 @@ bool hcd_init(uint8_t rhport)
177
177
ohci_data .bulk_head_ed .skip = 1 ;
178
178
ohci_data .period_head_ed .skip = 1 ;
179
179
180
+ //If OHCI hardware is in SMM mode, gain ownership (Ref OHCI spec 5.1.1.3.3)
181
+ if (OHCI_REG -> control_bit .interrupt_routing == 1 )
182
+ {
183
+ OHCI_REG -> command_status_bit .ownership_change_request = 1 ;
184
+ while (OHCI_REG -> control_bit .interrupt_routing == 1 ) {}
185
+ }
186
+
187
+ //If OHCI hardware has come from warm-boot, signal resume (Ref OHCI spec 5.1.1.3.4)
188
+ else if (OHCI_REG -> control_bit .hc_functional_state != OHCI_CONTROL_FUNCSTATE_RESET &&
189
+ OHCI_REG -> control_bit .hc_functional_state != OHCI_CONTROL_FUNCSTATE_OPERATIONAL )
190
+ {
191
+ //Wait 20 ms. (Ref Usb spec 7.1.7.7)
192
+ OHCI_REG -> control_bit .hc_functional_state = OHCI_CONTROL_FUNCSTATE_RESUME ;
193
+ osal_task_delay (20 );
194
+ }
195
+
180
196
// reset controller
181
197
OHCI_REG -> command_status_bit .controller_reset = 1 ;
182
198
while ( OHCI_REG -> command_status_bit .controller_reset ) {} // should not take longer than 10 us
You can’t perform that action at this time.
0 commit comments