m1n1.fw.asc: Make startup/shutdown more proper

Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
Hector Martin 2022-07-03 23:29:03 +09:00
parent 615878ce68
commit 4d8065807c
2 changed files with 7 additions and 5 deletions

View file

@ -101,10 +101,8 @@ class StandardASC(ASC):
ep.start()
def start(self):
if self.is_running():
super().boot()
self.mgmt.start()
else:
self.boot()
self.mgmt.wait_boot(1)
def stop(self, state=0x10):
@ -115,11 +113,13 @@ class StandardASC(ASC):
self.mgmt.stop(state=state)
self.epmap = {}
self.add_ep(0, ASCManagementEndpoint(self, 0))
if state < 0x10:
self.shutdown()
def boot(self):
print("Booting ASC...")
super().boot()
self.mgmt.wait_boot()
self.mgmt.wait_boot(1)
__all__.extend(k for k, v in globals().items()
if (callable(v) or isinstance(v, type)) and v.__module__ == __name__)

View file

@ -79,6 +79,8 @@ class ASC:
def boot(self):
self.asc.CPU_CONTROL.set(RUN=1)
def shutdown(self):
self.asc.CPU_CONTROL.set(RUN=0)
def add_ep(self, idx, ep):