proxy: Add proxy ops for pcie_init/shutdown

Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
Hector Martin 2021-11-22 16:04:35 +09:00
parent 660d7482b9
commit 4027c34c7a
3 changed files with 19 additions and 0 deletions

View file

@ -582,6 +582,9 @@ class M1N1Proxy(Reloadable):
P_FB_RESTORE_LOGO = 0xd07
P_FB_IMPROVE_LOGO = 0xd08
P_PCIE_INIT = 0xe00
P_PCIE_SHUTDOWN = 0xe01
def __init__(self, iface, debug=False):
self.debug = debug
self.iface = iface
@ -993,6 +996,11 @@ class M1N1Proxy(Reloadable):
def fb_improve_logo(self):
return self.request(self.P_FB_IMPROVE_LOGO)
def pcie_init(self):
return self.request(self.P_PCIE_INIT)
def pcie_shutdown(self):
return self.request(self.P_PCIE_SHUTDOWN)
__all__.extend(k for k, v in globals().items()
if (callable(v) or isinstance(v, type)) and v.__module__ == __name__)

View file

@ -11,6 +11,7 @@
#include "kboot.h"
#include "malloc.h"
#include "memory.h"
#include "pcie.h"
#include "pmgr.h"
#include "smp.h"
#include "string.h"
@ -483,6 +484,13 @@ int proxy_process(ProxyRequest *request, ProxyReply *reply)
fb_improve_logo();
break;
case P_PCIE_INIT:
pcie_init();
break;
case P_PCIE_SHUTDOWN:
pcie_shutdown();
break;
default:
reply->status = S_BADCMD;
break;

View file

@ -135,6 +135,9 @@ typedef enum {
P_FB_RESTORE_LOGO,
P_FB_IMPROVE_LOGO,
P_PCIE_INIT = 0xe00,
P_PCIE_SHUTDOWN,
} ProxyOp;
#define S_OK 0