Christopher Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame^] | 1 | /**************************************************************************** |
| 2 | **************************************************************************** |
| 3 | *** |
| 4 | *** This header was automatically generated from a Linux kernel header |
| 5 | *** of the same name, to make information necessary for userspace to |
| 6 | *** call into the kernel available to libc. It contains only constants, |
| 7 | *** structures, and macros generated from the original header, and thus, |
| 8 | *** contains no copyrightable information. |
| 9 | *** |
| 10 | *** To edit the content of this header, modify the corresponding |
| 11 | *** source file (e.g. under external/kernel-headers/original/) then |
| 12 | *** run bionic/libc/kernel/tools/update_all.py |
| 13 | *** |
| 14 | *** Any manual change here will be lost the next time this script will |
| 15 | *** be run. You've been warned! |
| 16 | *** |
| 17 | **************************************************************************** |
| 18 | ****************************************************************************/ |
| 19 | #ifndef __UAPI_LINUX_MISC_BCM_VK_H |
| 20 | #define __UAPI_LINUX_MISC_BCM_VK_H |
| 21 | #include <linux/ioctl.h> |
| 22 | #include <linux/types.h> |
| 23 | #define BCM_VK_MAX_FILENAME 64 |
| 24 | struct vk_image { |
| 25 | __u32 type; |
| 26 | #define VK_IMAGE_TYPE_BOOT1 1 |
| 27 | #define VK_IMAGE_TYPE_BOOT2 2 |
| 28 | __u8 filename[BCM_VK_MAX_FILENAME]; |
| 29 | }; |
| 30 | struct vk_reset { |
| 31 | __u32 arg1; |
| 32 | __u32 arg2; |
| 33 | }; |
| 34 | #define VK_MAGIC 0x5e |
| 35 | #define VK_IOCTL_LOAD_IMAGE _IOW(VK_MAGIC, 0x2, struct vk_image) |
| 36 | #define VK_IOCTL_RESET _IOW(VK_MAGIC, 0x4, struct vk_reset) |
| 37 | #define VK_BAR_FWSTS 0x41c |
| 38 | #define VK_BAR_COP_FWSTS 0x428 |
| 39 | #define VK_FWSTS_RELOCATION_ENTRY (1UL << 0) |
| 40 | #define VK_FWSTS_RELOCATION_EXIT (1UL << 1) |
| 41 | #define VK_FWSTS_INIT_START (1UL << 2) |
| 42 | #define VK_FWSTS_ARCH_INIT_DONE (1UL << 3) |
| 43 | #define VK_FWSTS_PRE_KNL1_INIT_DONE (1UL << 4) |
| 44 | #define VK_FWSTS_PRE_KNL2_INIT_DONE (1UL << 5) |
| 45 | #define VK_FWSTS_POST_KNL_INIT_DONE (1UL << 6) |
| 46 | #define VK_FWSTS_INIT_DONE (1UL << 7) |
| 47 | #define VK_FWSTS_APP_INIT_START (1UL << 8) |
| 48 | #define VK_FWSTS_APP_INIT_DONE (1UL << 9) |
| 49 | #define VK_FWSTS_MASK 0xffffffff |
| 50 | #define VK_FWSTS_READY (VK_FWSTS_INIT_START | VK_FWSTS_ARCH_INIT_DONE | VK_FWSTS_PRE_KNL1_INIT_DONE | VK_FWSTS_PRE_KNL2_INIT_DONE | VK_FWSTS_POST_KNL_INIT_DONE | VK_FWSTS_INIT_DONE | VK_FWSTS_APP_INIT_START | VK_FWSTS_APP_INIT_DONE) |
| 51 | #define VK_FWSTS_APP_DEINIT_START (1UL << 23) |
| 52 | #define VK_FWSTS_APP_DEINIT_DONE (1UL << 24) |
| 53 | #define VK_FWSTS_DRV_DEINIT_START (1UL << 25) |
| 54 | #define VK_FWSTS_DRV_DEINIT_DONE (1UL << 26) |
| 55 | #define VK_FWSTS_RESET_DONE (1UL << 27) |
| 56 | #define VK_FWSTS_DEINIT_TRIGGERED (VK_FWSTS_APP_DEINIT_START | VK_FWSTS_APP_DEINIT_DONE | VK_FWSTS_DRV_DEINIT_START | VK_FWSTS_DRV_DEINIT_DONE) |
| 57 | #define VK_FWSTS_RESET_REASON_SHIFT 28 |
| 58 | #define VK_FWSTS_RESET_REASON_MASK (0xf << VK_FWSTS_RESET_REASON_SHIFT) |
| 59 | #define VK_FWSTS_RESET_SYS_PWRUP (0x0 << VK_FWSTS_RESET_REASON_SHIFT) |
| 60 | #define VK_FWSTS_RESET_MBOX_DB (0x1 << VK_FWSTS_RESET_REASON_SHIFT) |
| 61 | #define VK_FWSTS_RESET_M7_WDOG (0x2 << VK_FWSTS_RESET_REASON_SHIFT) |
| 62 | #define VK_FWSTS_RESET_TEMP (0x3 << VK_FWSTS_RESET_REASON_SHIFT) |
| 63 | #define VK_FWSTS_RESET_PCI_FLR (0x4 << VK_FWSTS_RESET_REASON_SHIFT) |
| 64 | #define VK_FWSTS_RESET_PCI_HOT (0x5 << VK_FWSTS_RESET_REASON_SHIFT) |
| 65 | #define VK_FWSTS_RESET_PCI_WARM (0x6 << VK_FWSTS_RESET_REASON_SHIFT) |
| 66 | #define VK_FWSTS_RESET_PCI_COLD (0x7 << VK_FWSTS_RESET_REASON_SHIFT) |
| 67 | #define VK_FWSTS_RESET_L1 (0x8 << VK_FWSTS_RESET_REASON_SHIFT) |
| 68 | #define VK_FWSTS_RESET_L0 (0x9 << VK_FWSTS_RESET_REASON_SHIFT) |
| 69 | #define VK_FWSTS_RESET_UNKNOWN (0xf << VK_FWSTS_RESET_REASON_SHIFT) |
| 70 | #endif |