mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-11 02:04:11 +00:00
experiments/aop.py: Allocate oslog buffer on request
We need to allocate a buffer for the AOP on the OSLog endpoint for it to fully boot. Copy in a modified version of the general OSLog endpoint driver to do that. Signed-off-by: Martin Povišer <povik@protonmail.com>
This commit is contained in:
parent
f87d65a971
commit
6ad59beb0c
1 changed files with 25 additions and 0 deletions
|
@ -10,11 +10,36 @@ from m1n1.setup import *
|
||||||
from m1n1.shell import run_shell
|
from m1n1.shell import run_shell
|
||||||
from m1n1.hw.dart import DART, DARTRegs
|
from m1n1.hw.dart import DART, DARTRegs
|
||||||
from m1n1.fw.asc import StandardASC, ASCDummyEndpoint
|
from m1n1.fw.asc import StandardASC, ASCDummyEndpoint
|
||||||
|
from m1n1.fw.asc.base import *
|
||||||
from m1n1.fw.aop import *
|
from m1n1.fw.aop import *
|
||||||
|
|
||||||
|
class OSLogMessage(Register64):
|
||||||
|
TYPE = 63, 56
|
||||||
|
|
||||||
|
class OSLog_Init(OSLogMessage):
|
||||||
|
TYPE = 63, 56, Constant(1)
|
||||||
|
UNK = 51, 0
|
||||||
|
DVA = 7, 0
|
||||||
|
|
||||||
|
class AOPOSLogEndpoint(ASCBaseEndpoint):
|
||||||
|
BASE_MESSAGE = OSLogMessage
|
||||||
|
SHORT = "oslog"
|
||||||
|
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
super().__init__(*args, **kwargs)
|
||||||
|
self.started = False
|
||||||
|
|
||||||
|
@msg_handler(1, OSLog_Init)
|
||||||
|
def Init(self, msg):
|
||||||
|
self.iobuffer, self.iobuffer_dva = self.asc.ioalloc(0x1_0000)
|
||||||
|
self.send(OSLog_Init(DVA=self.iobuffer_dva//0x1000))
|
||||||
|
self.started = True
|
||||||
|
return True
|
||||||
|
|
||||||
class AOPClient(StandardASC):
|
class AOPClient(StandardASC):
|
||||||
ENDPOINTS = {
|
ENDPOINTS = {
|
||||||
|
8: AOPOSLogEndpoint,
|
||||||
|
|
||||||
0x20: ASCDummyEndpoint,
|
0x20: ASCDummyEndpoint,
|
||||||
0x21: ASCDummyEndpoint,
|
0x21: ASCDummyEndpoint,
|
||||||
0x22: ASCDummyEndpoint,
|
0x22: ASCDummyEndpoint,
|
||||||
|
|
Loading…
Reference in a new issue