umcpmioctlconst.h revision 1.1 1 /* $NetBSD: umcpmioctlconst.h,v 1.1 2024/12/16 16:37:40 brad Exp $ */
2
3 /*
4 * Copyright (c) 2024 Brad Spencer <brad (at) anduin.eldar.org>
5 *
6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18
19 #ifndef _UMCPMIOCTLCONST_H_
20 #define _UMCPMIOCTLCONST_H_
21
22 /* These structures describe the command line command structure */
23
24 static const struct umcpmioctlcmd umcpmioctlcmds[] = {
25 {
26 .cmd = "get",
27 .id = UMCPMIO_GET,
28 .helpargs = "sram|gp|flash cs|flash gp|flash usbman|flash usbprod|flash usbsn|flash chipsn"
29
30 },
31 {
32 .cmd = "put",
33 .id = UMCPMIO_PUT,
34 .helpargs = "flash gp"
35
36 },
37 {
38 .cmd = "status",
39 .id = UMCPMIO_STATUS,
40 .helpargs = ""
41 }
42 };
43
44 static const struct umcpmioctlcmd getsubcmds[] = {
45 {
46 .cmd = "sram",
47 .id = UMCPMIO_IOCTL_GET_SRAM,
48 .helpargs = ""
49 },
50 {
51 .cmd = "gp",
52 .id = UMCPMIO_IOCTL_GET_GP_CFG,
53 .helpargs = ""
54 },
55 {
56 .cmd = "flash",
57 .id = UMCPMIO_IOCTL_GET_FLASH,
58 .helpargs = "cs | gp | usbman | usbprod | usbsn | chipsn"
59 }
60 };
61
62 static const struct umcpmioctlcmd getflashsubcmds[] = {
63 {
64 .cmd = "cs",
65 .id = UMCPMIO_IOCTL_GET_FLASH_CS,
66 .helpargs = ""
67 },
68 {
69 .cmd = "gp",
70 .id = UMCPMIO_IOCTL_GET_FLASH_GP,
71 .helpargs = ""
72 },
73 {
74 .cmd = "usbman",
75 .id = UMCPMIO_IOCTL_GET_FLASH_USBMAN,
76 .helpargs = ""
77 },
78 {
79 .cmd = "usbprod",
80 .id = UMCPMIO_IOCTL_GET_FLASH_USBPROD,
81 .helpargs = ""
82 },
83 {
84 .cmd = "usbsn",
85 .id = UMCPMIO_IOCTL_GET_FLASH_USBSN,
86 .helpargs = ""
87 },
88 {
89 .cmd = "chipsn",
90 .id = UMCPMIO_IOCTL_GET_FLASH_CHIPSN,
91 .helpargs = ""
92 }
93 };
94
95 static const struct umcpmioctlcmd putsubcmds[] = {
96 {
97 .cmd = "flash",
98 .id = UMCPMIO_IOCTL_PUT_FLASH,
99 .helpargs = "gp GPn GPIO_PIN_INPUT\n\t\t\t\tGPIO_PIN_OUTPUT\n\t\t\t\tGPIO_PIN_ALT0\n\t\t\t\tGPIO_PIN_ALT1\n\t\t\t\tGPIO_PIN_ALT2\n\t\t\t\tGPIO_PIN_ALT3\n\t\t\t\tDEFAULT_OUTPUT_ZERO\n\t\t\t\tDEFAULT_OUTPUT_ONE....",
100 }
101 };
102
103 static const struct umcpmioctlcmd putflashsubcmds[] = {
104 {
105 .cmd = "gp",
106 .id = UMCPMIO_IOCTL_PUT_FLASH_GP,
107 .helpargs = ""
108 }
109 };
110
111
112 #endif
113