mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
upgrade link to high speed
This commit is contained in:
parent
9ec18eb045
commit
00db7d108d
1 changed files with 15 additions and 2 deletions
|
|
@ -1167,6 +1167,20 @@ impl CorigineUsb {
|
|||
println!("USB reset done: {:x}", dummy);
|
||||
}
|
||||
|
||||
pub fn se0_test(&mut self, value: bool) {
|
||||
crate::println!("cmd state: {:x}", self.csr.r(USBCMD));
|
||||
crate::println!("link state bef: {:x}", (self.csr.r(PORTSC) >> 5) & 0xf);
|
||||
let base = self.csr.r(U2PORTPMSC);
|
||||
if value {
|
||||
self.csr.wo(U2PORTPMSC, (base & 0x0FFF_FFFF) | (3 << 28));
|
||||
crate::println!("U2PORTPMSC: {:x}", self.csr.r(U2PORTPMSC));
|
||||
} else {
|
||||
self.csr.wo(U2PORTPMSC, (base & 0x0FFF_FFFF) | (0 << 28));
|
||||
crate::println!("U2PORTPMSC: {:x}", self.csr.r(U2PORTPMSC));
|
||||
}
|
||||
crate::println!("link state aft: {:x}", (self.csr.r(PORTSC) >> 5) & 0xf);
|
||||
}
|
||||
|
||||
pub fn init(&mut self) {
|
||||
self.csr.rmwf(USBCMD_INT_ENABLE, 0);
|
||||
self.csr.rmwf(USBCMD_RUN_STOP, 0);
|
||||
|
|
@ -1177,8 +1191,7 @@ impl CorigineUsb {
|
|||
// wait for reset to finish
|
||||
}
|
||||
|
||||
// TODO: ugprade this to HS
|
||||
self.csr.wo(DEVCONFIG, 0x80 | CRG_UDC_CFG0_MAXSPEED_FS);
|
||||
self.csr.wo(DEVCONFIG, 0x80 | CRG_UDC_CFG0_MAXSPEED_FS | CRG_UDC_CFG0_MAXSPEED_HS);
|
||||
|
||||
self.csr.wo(
|
||||
EVENTCONFIG,
|
||||
|
|
|
|||
Loading…
Reference in a new issue