1 /* $NetBSD: umcpmioctl.h,v 1.2 2024/12/21 13:48:32 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 _UMCPMIOCTL_H_ 20 #define _UMCPMIOCTL_H_ 21 22 /* Top level commands */ 23 #define UMCPMIO_GET 1 24 #define UMCPMIO_PUT 2 25 #define UMCPMIO_STATUS 3 26 27 /* Second level commands */ 28 29 #define UMCPMIO_IOCTL_GET_SRAM 1 30 #define UMCPMIO_IOCTL_GET_GP_CFG 2 31 #define UMCPMIO_IOCTL_GET_FLASH 3 32 33 #define UMCPMIO_IOCTL_PUT_FLASH 1 34 35 /* Third level commands */ 36 37 #define UMCPMIO_IOCTL_GET_FLASH_CS 0 38 #define UMCPMIO_IOCTL_GET_FLASH_GP 1 39 #define UMCPMIO_IOCTL_GET_FLASH_USBMAN 2 40 #define UMCPMIO_IOCTL_GET_FLASH_USBPROD 3 41 #define UMCPMIO_IOCTL_GET_FLASH_USBSN 4 42 #define UMCPMIO_IOCTL_GET_FLASH_CHIPSN 5 43 44 #define UMCPMIO_IOCTL_PUT_FLASH_GP 1 45 46 struct umcpmioctlcmd { 47 const char *cmd; 48 const int id; 49 const char *helpargs; 50 }; 51 52 #endif 53