1 // SPDX-License-Identifier: MIT
3 // Currently "2011" / 0x07DB - Defined as "Reserved for Hackers Only" in old Commodore documentation
4 #define PISTORM_AC_MANUF_ID 0x0, 0x7, 0xD, 0xB
6 // [R], [W] and [RW] indicate read, write or both access modes for register
7 // Any failure or result code from a write command should be put in PI_CMDRESULT
8 enum pistorm_dev_cmds {
9 PI_CMD_RESET = 0x00, // [W] Reset the host system.
10 PI_CMD_SWITCHCONFIG = 0x02, // [W] Switch config file to string at PI_STR1, if it exists.
11 // This will reset the Amiga if the config loads successfully.
12 PI_CMD_PISCSI_CTRL = 0x04, // [RW] Write: Control a PiSCSI device. The command written here uses
13 // values From various data registers around $2000.
14 // Read: Returns whether PiSCSI is enabled or not.
15 PI_CMD_RTGSTATUS = 0x06, // [RW] Read: Check RTG status Write: Set RTG status (enabled/disabled)
16 PI_CMD_NETSTATUS = 0x08, // [RW] Read: Check ETH status Write: Set ETH status (enabled/disabled)
17 PI_CMD_KICKROM = 0x0A, // [W] Map a different Kickstart ROM to the standard address using
18 // the string at PI_STR1, if the file exists. Requires some config
19 // file names to be set in order to find it.
20 PI_CMD_EXTROM = 0x0E, // [W] Same as above, but the extended ROM.
22 PI_CMD_HWREV = 0x10, // [R] Check the PiStorm hardware version/revision
23 PI_CMD_SWREV = 0x12, // [R] Check the PiStorm software version/revision
25 PI_CMD_FILESIZE = 0x0100, // [R] Get the file size for file on the Pi side using the path
26 // at PI_STR1, if it exists.
27 PI_CMD_TRANSFERFILE = 0x0104, // [W] Transfer over a file from the Pi to Amiga RAM.
28 PI_CMD_MEMCPY = 0x0108, // [W] Copy written longword of bytes from one area of memory (PTR1)
31 PI_CMD_QBASIC = 0x0FFC, // QBasic
32 PI_CMD_NIBBLES = 0x0FFE, // Nibbles
34 PI_DBG_MSG = 0x1000, // [W] Trigger debug message output to avoid slow serial kprintf.
35 PI_DBG_VAL1 = 0x1010, // [RW]
36 PI_DBG_VAL2 = 0x1014, // [RW]
37 PI_DBG_VAL3 = 0x1018, // [RW]
38 PI_DBG_VAL4 = 0x101C, // [RW]
39 PI_DBG_VAL5 = 0x1020, // [RW]
40 PI_DBG_VAL6 = 0x1024, // [RW]
41 PI_DBG_VAL7 = 0x1028, // [RW]
42 PI_DBG_VAL8 = 0x102C, // [RW]
43 PI_DBG_STR1 = 0x1030, // [W] Pointers to debug strings (typically in Amiga RAM)
44 PI_DBG_STR2 = 0x1034, // [W]
45 PI_DBG_STR3 = 0x1038, // [W]
46 PI_DBG_STR4 = 0x103C, // [W]
48 PI_CMD_SHUTDOWN = 0x1FFC, // [W] Initiate requesting the Pi to shut down
49 PI_CMD_CONFIRMSHUTDOWN = 0x1FFE, // [W] Confirm shutting down the Pi
51 PI_BYTE1 = 0x2000, // [RW] // Bytes, words and longwords used as extended arguments.
52 PI_BYTE2 = 0x2001, // [RW] // for PiStorm interaction device commands.
53 PI_BYTE3 = 0x2002, // [RW]
54 PI_BYTE4 = 0x2003, // [RW]
55 PI_BYTE5 = 0x2004, // [RW]
56 PI_BYTE6 = 0x2005, // [RW]
57 PI_BYTE7 = 0x2006, // [RW]
58 PI_BYTE8 = 0x2007, // [RW]
59 PI_WORD1 = 0x2008, // [RW]
60 PI_WORD2 = 0x200A, // [RW]
61 PI_WORD3 = 0x200C, // [RW]
62 PI_WORD4 = 0x200E, // [RW]
63 PI_LONGWORD1 = 0x2010, // [RW]
64 PI_LONGWORD2 = 0x2014, // [RW]
65 PI_LONGWORD3 = 0x2018, // [RW]
66 PI_LONGWORD4 = 0x201C, // [RW]
67 PI_STR1 = 0x2020, // [W] Pointers to strings (typically in Amiga RAM)
68 PI_STR2 = 0x2024, // [W]
69 PI_STR3 = 0x2028, // [W]
70 PI_STR4 = 0x202C, // [W]
71 PI_PTR1 = 0x2030, // [W] Pointers to allocated memory in Amiga RAM.
72 PI_PTR2 = 0x2034, // [W] For instance for loading large files to Amiga RAM or
73 PI_PTR3 = 0x2038, // [W] transferring over files from the Pi side of things.
74 PI_PTR4 = 0x203C, // [W]
76 PI_CMDRESULT = 0x2100, // [R] Check the result of any command that provides a "return value".
79 enum pistorm_piscsi_commands {
81 PISCSI_CTRL_MAP, // For hard drives
83 PISCSI_CTRL_EJECT, // For optical media, not yet implemented
84 PISCSI_CTRL_INSERT, //
85 PISCSI_CTRL_ENABLE, // Enable PiSCSI
86 PISCSI_CTRL_DISABLE, // Disable PiSCSI
90 enum pistorm_config_commands {
91 PICFG_LOAD, // Load a config file from string at PI_STR1
92 PICFG_RELOAD, // Reload current config file, in case hard drives or ROM has been changed
93 PICFG_DEFAULT, // Load default.cfg if it exists
97 enum pistorm_command_results {