mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-27 00:40:17 +00:00
m1n1.fw.asc: Make startup/shutdown more proper
Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
parent
615878ce68
commit
4d8065807c
2 changed files with 7 additions and 5 deletions
|
@ -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__)
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue