summaryrefslogtreecommitdiffstats
path: root/sys/powerpc
diff options
context:
space:
mode:
authorrpaulo <rpaulo@FreeBSD.org>2013-07-02 06:59:37 +0000
committerrpaulo <rpaulo@FreeBSD.org>2013-07-02 06:59:37 +0000
commitf76d8b3b46d61fb2c1baa67caf5fef192bfb050a (patch)
tree96ab0b8e23fa200c055cc4e7d0b80822d9720e76 /sys/powerpc
parent4fe3ea187e8579d0d972187532740bae74fee03d (diff)
downloadFreeBSD-src-f76d8b3b46d61fb2c1baa67caf5fef192bfb050a.zip
FreeBSD-src-f76d8b3b46d61fb2c1baa67caf5fef192bfb050a.tar.gz
Add register definitions for the Wii IPC system.
Diffstat (limited to 'sys/powerpc')
-rw-r--r--sys/powerpc/wii/wii_ipcreg.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/sys/powerpc/wii/wii_ipcreg.h b/sys/powerpc/wii/wii_ipcreg.h
index 197a4e0..4d0ff1a 100644
--- a/sys/powerpc/wii/wii_ipcreg.h
+++ b/sys/powerpc/wii/wii_ipcreg.h
@@ -34,4 +34,69 @@
#define WIIIPC_IOH_ADDR 0x133e0000
#define WIIIPC_IOH_LEN 0xc20000
+#define WIIIPC_TXBUF 0x00
+#define WIIIPC_CSR 0x04
+#define WIIIPC_CSR_TXSTART 0x01
+#define WIIIPC_CSR_TBEI 0x02
+#define WIIIPC_CSR_RBFI 0x04
+#define WIIIPC_CSR_RXREADY 0x08
+#define WIIIPC_CSR_RBFIMASK 0x10
+#define WIIIPC_CSR_TBEIMASK 0x20
+#define WIIIPC_RXBUF 0x08
+#define WIIIPC_ISR 0x30
+#define WIIIPC_ISR_MAGIC 0x40000000
+
+enum wiiipc_cmd {
+ WIIIPC_CMD_OPEN = 1,
+ WIIIPC_CMD_CLOSE = 2,
+ WIIIPC_CMD_READ = 3,
+ WIIIPC_CMD_WRITE = 4,
+ WIIIPC_CMD_SEEK = 5,
+ WIIIPC_CMD_IOCTL = 6,
+ WIIIPC_CMD_IOCTLV = 7,
+ WIIIPC_CMD_ASYNCRESP = 8
+};
+
+struct wiiipc_ipc_msg {
+ uint32_t ipc_cmd;
+ int32_t ipc_result;
+ int32_t ipc_fd; /* WIIIPC_CMD_ASYNCRESP - the original cmd */
+ union {
+ struct {
+ intptr_t pathname;
+ uint32_t mode;
+ } _ipc_open;
+ struct {
+ intptr_t data;
+ uint32_t len;
+ } _ipc_read, _ipc_write;
+ struct {
+ int32_t offset;
+ int32_t whence;
+ } _ipc_seek;
+ struct {
+ uint32_t request;
+ intptr_t ibuf;
+ uint32_t ilen;
+ intptr_t obuf;
+ uint32_t olen;
+ } _ipc_ioctl;
+ struct {
+ uint32_t request;
+ uint32_t argin;
+ uint32_t argout;
+ intptr_t iovec;
+ } _ipc_ioctlv;
+ uint32_t _ipc_argv[5];
+ } args;
+} __attribute__((packed));
+
+CTASSERT(sizeof(struct wiiipc_ipc_msg) == 32);
+
+#define ipc_open args._ipc_open
+#define ipc_read args._ipc_read
+#define ipc_write args._ipc_write
+#define ipc_ioctl args._ipc_ioctl
+#define ipc_ioctlv args._ipc_ioctlv
+
#endif /* _POWERPC_WII_WII_IPCREG_H */
OpenPOWER on IntegriCloud